# 模板文件

根据框架设计和高可用性要求,我们自研了一套精细化的模板,基于FreeMarker编写,遵循FreeMarker书写规范,如需根据自己需要二次开发的小伙伴可以直接修改,根据层级结构的划分,框架所用到的模板文件包括:控制器模板模型模板服务层模板数据列表页模板编辑表单页模板JS模板,下面逐个完整的诠释每个模板文件的内容:

# 控制器模板


// +----------------------------------------------------------------------
// | RXThinkCMF框架 [ RXThinkCMF ]
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 南京RXThinkCMF研发中心
// +----------------------------------------------------------------------
// | 官方网站: http://www.rxthink.cn
// +----------------------------------------------------------------------
// | Author: 牧羊人 <1175401194@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\controller;


use app\admin\service\<?php echo $moduleName?>Service;
use app\common\controller\Backend;

/**
 * <?php echo $moduleTitle?>管理-控制器
 * @author <?php echo $author?>

 * @since: <?php echo $since?>

 * Class <?php echo $moduleName?>

 * @package app\admin\controller
 */
class <?php echo $moduleName?> extends Backend
{
    /**
     * 初始化方法
     * @author <?php echo $author?>

     * @since: <?php echo $since?>

     */
    public function initialize()
    {
        parent::initialize(); // TODO: Change the autogenerated stub
        $this->model = new \app\admin\model\<?php echo $moduleName?>();
        $this->service = new <?php echo $moduleName?>Service();
    }
	
	<?php if ($columnList) {?>
<?php foreach ($columnList as $val) { ?>
    <?php if (isset($val['columnSwitch']) && $val['columnSwitch']) {?>
	
	/**
	 * 设置<?php echo $val['columnComment']?>
	 
	 * @return mixed
	 * @since <?php echo $since?>
	 
	 * @author <?php echo $author?>
	 
	 */
	public function <?php echo $val['columnSwitchName']?>()
	{
		if (IS_POST) {
			$result = $this->service-><?php echo $val['columnSwitchName']?>();
			return $result;
		}
	}
	<?php } ?>
<?php } ?>
<?php } ?>
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

# 模型模板


// +----------------------------------------------------------------------
// | RXThinkCMF框架 [ RXThinkCMF ]
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 南京RXThinkCMF研发中心
// +----------------------------------------------------------------------
// | 官方网站: http://www.rxthink.cn
// +----------------------------------------------------------------------
// | Author: 牧羊人 <1175401194@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\model;


use app\common\model\BaseModel;

/**
 * <?php echo $moduleTitle?>-模型
 * @author <?php echo $author?>

 * @since: <?php echo $since?>

 * Class <?php echo $moduleName?>

 * @package app\admin\model
 */
class <?php echo $moduleName?> extends BaseModel
{
    // 设置数据表名
    protected $name = "<?php echo $tableName?>";

    /**
     * 获取缓存信息
     * @param int $id 记录ID
     * @return \app\common\model\数据信息|mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @author <?php echo $author?>

     * @since: <?php echo $since?>

     */
    public function getInfo($id)
    {
        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
        if ($info) {
    <?php if ($columnList) {?>
    <?php foreach ($columnList as $val) { ?>
        <?php if (isset($val['columnImage']) && $val['columnImage']) {?>

            // <?php echo $val['columnComment']?>

            $info['<?php echo $val['columnName']?>'] = get_image_url($info['<?php echo $val['columnName']?>']);
        <?php } ?>
    <?php } ?>
    <?php } ?>

        }
        return $info;
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

# 服务层模板


// +----------------------------------------------------------------------
// | RXThinkCMF框架 [ RXThinkCMF ]
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 南京RXThinkCMF研发中心
// +----------------------------------------------------------------------
// | 官方网站: http://www.rxthink.cn
// +----------------------------------------------------------------------
// | Author: 牧羊人 <1175401194@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\service;


use app\admin\model\<?php echo $moduleName?>;
use app\common\service\BaseService;

/**
 * <?php echo $moduleTitle?>管理-服务类
 * @author <?php echo $author?>

 * @since: <?php echo $since?>

 * Class <?php echo $moduleName?>Service
 * @package app\admin\service
 */
class <?php echo $moduleName?>Service extends BaseService
{
    /**
     * 构造函数
     * LevelService constructor.
     */
    public function __construct()
    {
        $this->model = new <?php echo $moduleName?>();
    }
	
	/**
     * 获取数据列表
     * @return array
     * @since <?php echo $since?>
     * @author <?php echo $author?>
     */
    public function getList()
    {
        $param = request()->param();

        // 查询条件
        $map = [];
		
<?php foreach ($queryList as $val) {?>
	<?php if (isset($val['columnValue'])) {?>

	    // <?php echo $val['columnComment'];?>

        $<?php echo $val['columnName']?> = isset($param['<?php echo $val['columnName']?>']) ? (int)$param['<?php echo $val['columnName']?>'] : 0;
        if ($<?php echo $val['columnName']?>) {
            $map[] = ['<?php echo $val['columnName']?>', '=', $<?php echo $val['columnName']?>];
        }
	<?php } else {?>

	    // <?php echo $val['columnComment'];?>

        $<?php echo $val['columnName']?> = isset($param['<?php echo $val['columnName']?>']) ? trim($param['<?php echo $val['columnName']?>']) : '';
        if ($<?php echo $val['columnName']?>) {
            $map[] = ['<?php echo $val['columnName']?>', 'like', "%{$<?php echo $val['columnName']?>}%"];
        }
	<?php } ?>
<?php } ?>

        return parent::getList($map); // TODO: Change the autogenerated stub
    }

<?php if ($moduleImage) {?>
	/**
     * 添加或编辑
     * @return array
     * @since <?php echo $since?>

     * @author <?php echo $author?>

     */
    public function edit()
    {
        // 参数
        $data = request()->param();
	<?php foreach ($columnList as $val) { ?>
        <?php if (isset($val['columnImage']) && $val['columnImage']) {?>

		// <?php echo $val['columnComment']?>处理
        $<?php echo $val['columnName']?> = trim($data['<?php echo $val['columnName']?>']);
        if (strpos($<?php echo $val['columnName']?>, "temp")) {
            $data['<?php echo $val['columnName']?>'] = save_image($<?php echo $val['columnName']?>, '<?php echo strtolower($moduleName)?>');
        } else {
            $data['<?php echo $val['columnName']?>'] = str_replace(IMG_URL, "", $data['<?php echo $val['columnName']?>']);
        }
        <?php } ?>
    <?php } ?>
        
        return parent::edit($data); // TODO: Change the autogenerated stub
    }
<?php } ?>

<?php if ($columnList) {?>
<?php foreach ($columnList as $val) { ?>
    <?php if (isset($val['columnSwitch']) && $val['columnSwitch']) {?>
	
	/**
     * 设置<?php echo $val['columnComment']?>
     
	 * @return array
     * @throws \think\db\exception\BindParamException
     * @throws \think\exception\PDOException
     * @since <?php echo $since?>
     
	 * @author <?php echo $author?>
     
	 */
    public function <?php echo $val['columnSwitchName']?>()
    {
		// 参数
        $data = request()->param();
        if (!$data['id']) {
            return message('记录ID不能为空', false);
        }
		if (!$data['<?php echo $val['columnName']?>']) {
            return message('记录<?php echo $val['columnComment']?>不能为空', false);
        }
        $error = '';
        $rowId = $this->model->edit($data, $error);
        if (!$rowId) {
            return message($error, false);
        }
        return message();
    }
	<?php } ?>
<?php } ?>
<?php } ?>

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

# 数据列表页模板


<!-- 引入基类模板 -->
{extend name='public/base' /}

<!-- 主体部分 -->
{block name='content'}

    <!-- 功能操作区一 -->
    <form class="layui-form toolbar">
        <div class="layui-form-item">
        <?php foreach ($queryList as $val) {?>
            <?php if (isset($val['columnValue'])) {?>

            <!-- <?php echo $val['columnComment'];?> -->
            <div class="layui-inline">
                <label class="layui-form-label w-auto"><?php echo $val['columnComment']?>:</label>
                <div class="layui-input-inline">
                    {common:select param="<?php echo $val['columnName']?>|0|<?php echo $val['columnComment']?>|name|id" data="<?php echo $val['columnValue']?>" value="0"}
                </div>
            </div>
            <?php } else {?>

            <!-- <?php echo $val['columnComment'];?> -->
            <div class="layui-inline">
                <label class="layui-form-label w-auto"><?php echo $val['columnComment']?>:</label>
                <div class="layui-input-inline">
                    <input type="text" name="<?php echo $val['columnName']?>" placeholder="请输入<?php echo $val['columnComment']?>" autocomplete="off" class="layui-input">
                </div>
            </div>
            <?php } ?>
        <?php } ?>

            <div class="layui-inline">
                <div class="layui-input-inline" style="width: auto;">
                    {widget:query name="查询"}
                    {widget:add name="添加<?php echo $moduleTitle?>"}
                    {widget:dall name="批量删除"}
                </div>
            </div>
        </div>
    </form>

    <!-- TABLE渲染区 -->
    <table class="layui-hide" id="tableList" lay-filter="tableList"></table>

    <!-- 操作功能区二 -->
    <script type="text/html" id="toolBar">
        {widget:edit name="编辑"}
        {widget:delete name="删除"}
    </script>
<?php foreach ($queryList as $val) {?>
<?php if (isset($val['columnSwitch']) && $val['columnSwitch']){ ?>

    <!-- <?php echo $val['columnComment']?> -->
    <script type="text/html" id="<?php echo $val['columnName']?>Tpl">
        <input type="checkbox" name="<?php echo $val['columnName']?>" value="{literal}{{ d.id }}{/literal}" lay-skin="switch" lay-text="<?php echo $val['columnSwitchValue']?>" lay-filter="<?php echo $val['columnName']?>" {literal}{{ d.<?php echo $val['columnName']?> == 1 ? 'checked' : '' }}{/literal} >
    </script>
<?php } ?>
<?php } ?>

{/block}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

# 编辑表单页模板(一行一列)

<form class="layui-form model-form" action="">
    <input name="id" id="id" type="hidden" value="{$info.id|default=0}">
<?php if ($columnList) {?>
    <?php foreach ($columnList as $val) { ?>
    <?php if (isset($val['columnUpload'])) {?>

    <div class="layui-form-item">
        <label class="layui-form-label"><?php echo $val['columnComment']?>:</label>
        {upload:image name="<?php echo $val['columnName']?>|<?php echo $val['columnComment']?>|90x90|建议上传尺寸450x450|450x450" value="isset($info['<?php echo $val['columnName']?>']) ? $info['<?php echo $val['columnName']?>'] : ''"}
    </div>
    <?php } elseif (isset($val['columnRow'])) { ?>

    <div class="layui-form-item layui-form-text" style="width:625px;">
        <label class="layui-form-label"><?php echo $val['columnComment']?>:</label>
        <div class="layui-input-block">
            <textarea name="<?php echo $val['columnName']?>" placeholder="请输入<?php echo $val['columnComment']?>" class="layui-textarea">{$info['<?php echo $val['columnName']?>']|default=''}</textarea>
            <?php if ($val['dataType']=="text") {?>

                {editor:kindeditor name="<?php echo $val['columnName']?>" type="default" width="100%" height="350"}
            <?php } ?>

        </div>
    </div>
    <?php } else {?>

    <div class="layui-form-item">
        <label class="layui-form-label"><?php echo $val['columnComment']?>:</label>
        <div class="layui-input-block">
    <?php if (isset($val['columnValue'])) {?>
        <?php if (isset($val['columnSwitch']) && $val['columnSwitch']) {?>

            {common:switch name="<?php echo $val['columnName']?>" title="<?php echo $val['columnSwitchValue']?>" value="isset($info['<?php echo $val['columnName']?>']) ? $info['<?php echo $val['columnName']?>'] : <?php echo $val['columnDefault']?>"}
        <?php } else {?>

            {common:select param="<?php echo $val['columnName']?>|1|<?php echo $val['columnComment']?>|name|id" data="<?php echo $val['columnValue']?>" value="isset($info['<?php echo $val['columnName']?>']) ? $info['<?php echo $val['columnName']?>'] : <?php echo $val['columnDefault']?>"}
        <?php } ?>
    <?php } elseif ($val['dataType'] == 'bigint' || $val['dataType'] == 'int' || $val['dataType'] == 'smallint' || $val['dataType'] == 'tinyint') {?>

        <input name="<?php echo $val['columnName']?>" value="{$info['<?php echo $val['columnName']?>']|default=0}" lay-verify="required|number" autocomplete="off" placeholder="请输入<?php echo $val['columnComment']?>" class="layui-input" type="text">
    <?php } elseif ($val['dataType'] == 'date' || $val['dataType'] == 'datetime') {?>

        {date:select param="<?php echo $val['columnName']?>|<?php echo $val['columnComment']?>|<?php echo $val['dataType']?>" value="$info['<?php echo $val['columnName']?>']|default=''"}
    <?php } else {?>
        <input name="<?php echo $val['columnName']?>" value="{$info['<?php echo $val['columnName']?>']|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入<?php echo $val['columnComment']?>" class="layui-input" type="text">
    <?php } ?>

        </div>
    </div>
    <?php } ?>
    <?php } ?>
<?php } ?>

    {widget:submit name="submit|立即保存,close|关闭"}
</form>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

# 编辑表单页模板(一行两列)

<form class="layui-form model-form" action="">
    <input name="id" id="id" type="hidden" value="{$info.id|default=0}">
<?php if ($columnList) {?>
    <?php foreach ($columnList as $val) { ?>
    <?php if (isset($val[0]['columnUpload'])) {?>

    <div class="layui-form-item">
        <label class="layui-form-label"><?php echo $val[0]['columnComment']?>:</label>
        {upload:image name="<?php echo $val[0]['columnName']?>|<?php echo $val[0]['columnComment']?>|90x90|建议上传尺寸450x450|450x450" value="isset($info['<?php echo $val[0]['columnName']?>']) ? $info['<?php echo $val[0]['columnName']?>'] : ''"}
    </div>
    <?php } elseif (isset($val[0]['columnRow'])) { ?>

    <div class="layui-form-item layui-form-text" style="width:625px;">
        <label class="layui-form-label"><?php echo $val[0]['columnComment']?>:</label>
        <div class="layui-input-block">
            <textarea name="<?php echo $val[0]['columnName']?>" placeholder="请输入<?php echo $val[0]['columnComment']?>" class="layui-textarea">{$info['<?php echo $val[0]['columnName']?>']|default=''}</textarea>
            <?php if ($val[0]['dataType']=="text") {?>

            {editor:kindeditor name="<?php echo $val[0]['columnName']?>" type="default" width="100%" height="350"}
            <?php } ?>

        </div>
    </div>
    <?php } else {?>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><?php echo $val[0]['columnComment']?>:</label>
            <div class="layui-input-inline">
            <?php if (isset($val[0]['columnValue'])) {?>
                <?php if (isset($val[0]['columnSwitch']) && $val[0]['columnSwitch']) {?>

                {common:switch name="<?php echo $val[0]['columnName']?>" title="<?php echo $val[0]['columnSwitchValue']?>" value="isset($info['<?php echo $val[0]['columnName']?>']) ? $info['<?php echo $val[0]['columnName']?>'] : <?php echo $val[0]['columnDefault']?>"}
                <?php } else {?>

                {common:select param="<?php echo $val[0]['columnName']?>|1|<?php echo $val[0]['columnComment']?>|name|id" data="<?php echo $val[0]['columnValue']?>" value="isset($info['<?php echo $val[0]['columnName']?>']) ? $info['<?php echo $val[0]['columnName']?>'] : <?php echo $val[0]['columnDefault']?>"}
                <?php } ?>
            <?php } elseif ($val[0]['dataType'] == 'bigint' || $val[0]['dataType'] == 'int' || $val[0]['dataType'] == 'smallint' || $val[0]['dataType'] == 'tinyint') {?>

                <input name="<?php echo $val[0]['columnName']?>" value="{$info['<?php echo $val[0]['columnName']?>']|default=0}" lay-verify="required|number" autocomplete="off" placeholder="请输入<?php echo $val[0]['columnComment']?>" class="layui-input" type="text">
            <?php } elseif ($val[0]['dataType'] == 'date' || $val[0]['dataType'] == 'datetime') {?>

                {date:select param="<?php echo $val[0]['columnName']?>|<?php echo $val[0]['columnComment']?>|<?php echo $val[0]['dataType']?>" value="$info['<?php echo $val[0]['columnName']?>']|default=''"}
            <?php } else {?>

                <input name="<?php echo $val[0]['columnName']?>" value="{$info['<?php echo $val[0]['columnName']?>']|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入<?php echo $val[0]['columnComment']?>" class="layui-input" type="text">
            <?php } ?>

            </div>
        </div>
        <?php if (isset($val[1])) {?>
<div class="layui-inline">
            <label class="layui-form-label"><?php echo $val[1]['columnComment']?>:</label>
            <div class="layui-input-inline">
            <?php if (isset($val[1]['columnValue'])) {?>
                <?php if (isset($val[1]['columnSwitch']) && $val[1]['columnSwitch']) {?>

                {common:switch name="<?php echo $val[1]['columnName']?>" title="<?php echo $val[1]['columnSwitchValue']?>" value="isset($info['<?php echo $val[1]['columnName']?>']) ? $info['<?php echo $val[1]['columnName']?>'] : <?php echo $val[1]['columnDefault']?>"}
            <?php } else {?>

                {common:select param="<?php echo $val[1]['columnName']?>|1|<?php echo $val[1]['columnComment']?>|name|id" data="<?php echo $val[1]['columnValue']?>" value="isset($info['<?php echo $val[1]['columnName']?>']) ? $info['<?php echo $val[1]['columnName']?>'] : <?php echo $val[1]['columnDefault']?>"}
            <?php } ?>
            <?php } elseif ($val[1]['dataType'] == 'bigint' || $val[1]['dataType'] == 'int' || $val[1]['dataType'] == 'smallint' || $val[1]['dataType'] == 'tinyint') {?>

                <input name="<?php echo $val[1]['columnName']?>" value="{$info['<?php echo $val[1]['columnName']?>']|default=0}" lay-verify="required|number" autocomplete="off" placeholder="请输入<?php echo $val[1]['columnComment']?>" class="layui-input" type="text">
            <?php } elseif ($val[1]['dataType'] == 'date' || $val[1]['dataType'] == 'datetime') {?>

                {date:select param="<?php echo $val[1]['columnName']?>|<?php echo $val[1]['columnComment']?>|<?php echo $val[1]['dataType']?>" value="$info['<?php echo $val[1]['columnName']?>']|default=''"}
            <?php } else {?>

                <input name="<?php echo $val[1]['columnName']?>" value="{$info['<?php echo $val[1]['columnName']?>']|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入<?php echo $val[1]['columnComment']?>" class="layui-input" type="text">
            <?php } ?>

            </div>
        </div>
        <?php } ?>

    </div>
    <?php } ?>
    <?php } ?>
<?php } ?>

    {widget:submit name="submit|立即保存,close|关闭"}
</form>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

# JS文件模板

/**
 * <?php echo $moduleTitle;?>管理
 * @author <?php echo $author?>

 * @since <?php echo $since?>

 */
layui.use(['function'], function () {
    //声明变量
    var func = layui.function
        , $ = layui.$;

    if (A == 'index') {
        //【TABLE列数组】
        var cols = [
            {type: 'checkbox', fixed: 'left'}
            , {field: 'id', width: 80, title: 'ID', align: 'center', sort: true, fixed: 'left'}
<?php foreach ($columnList as $val) {?>
<?php if ($val['columnName'] != 'id' && $val['columnName'] != 'create_user' && $val['columnName'] != 'create_time' && $val['columnName'] != 'update_time' && $val['columnName'] != 'mark') {?>
<?php if (isset($val['columnSwitch']) && $val['columnSwitch']) {?>
            , {field: '<?php echo $val['columnName']?>', width: 100, title: '<?php echo $val['columnComment']?>', align: 'center', templet: '#<?php echo $val['columnName']?>Tpl'}
<?php } elseif (isset($val['columnImage']) && $val['columnImage']) {?>
            , {field: '<?php echo $val['columnName']?>', width: 60, title: '<?php echo $val['columnComment']?>', align: 'center', templet: function (d) {
                var <?php echo $val['columnName']?> = "";
                if (d.<?php echo $val['columnName']?>) {
                    <?php echo $val['columnName']?> = '<a href="' + d.<?php echo $val['columnName']?> + '" target="_blank"><img src="' + d.<?php echo $val['columnName']?> + '" height="26" /></a>';
                }
                return <?php echo $val['columnName']?>;
                }
            }
<?php } else {?>
            , {field: '<?php echo $val['columnName']?>', width: 100, title: '<?php echo $val['columnComment']?>', align: 'center'}
<?php } ?>
<?php } ?>
<?php } ?>
            , {field: 'create_user_name', width: 100, title: '创建人', align: 'center'}
            , {field: 'create_time', width: 180, title: '创建时间', align: 'center', sort: true}
            , {field: 'update_time', width: 180, title: '更新时间', align: 'center', sort: true}
            , {fixed: 'right', width: 150, title: '功能操作', align: 'center', toolbar: '#toolBar'}
        ];

        //【渲染TABLE】
        func.tableIns(cols, "tableList");

        //【设置弹框】
<?php if ($columnSplit) {?>
        func.setWin("<?php echo $moduleTitle;?>");
<?php } else {?>
        func.setWin("<?php echo $moduleTitle;?>", 500, 400);
<?php } ?>

<?php foreach ($columnList as $val) {?>
    <?php if (isset($val['columnSwitch']) && $val['columnSwitch']) {?>

        //【设置<?php echo $val['columnComment']?>】
        func.formSwitch('<?php echo $val['columnName']?>', null, function (data, res) {
            console.log("开关回调成功");
        });

    <?php } ?>
<?php } ?>

    }
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64