puzhibing
2023-11-28 7b726d5ff439e7b8bb66369ecc5881e370286bc8
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
/**
 * 角色管理的单例
 */
var HomeSystemConfigure = {
};
 
let editor = null;
let editorhtml = null;
 
/**
 * 修改转发状态
 * @param id
 * @param s
 */
HomeSystemConfigure.saveHomeSystemConfigure = function(){
    let content = "";
    const label1 = $('#label1').val();
    const label2 = $('#label2').val();
    const label3 = $('#label3').val();
    const label4 = $('#label4').val();
    const label5 = $('#label5').val();
    const label6 = $('#label6').val();
    const label7 = $('#label7').val();
    const label8 = $('#label8').val();
    const label9 = $('#label9').val();
    const label10 = $('#label10').val();
    if(null == label1 || '' == label1 || null == label2 || '' == label2 || null == label3 || '' == label3 || null == label4 || '' == label4
        || null == label5 || '' == label5 || null == label6 || '' == label6 || null == label7 || '' == label7 || null == label8 || '' == label8
        || null == label9 || '' == label9 || null == label10 || '' == label10){
        Feng.error("请填写完整信息");
        return
    }
    content = [label1, label2, label3, label4, label5, label6, label7, label8, label9, label10];
    var ajax = new $ax(Feng.ctxPath + "/systemConfigure/saveSystemConfigure", function (data) {
        if(data.code == 200 ){
            Feng.success("保存成功!");
            HomeSystemConfigure.table.refresh();
        }else{
            Feng.error(data.msg);
        }
    }, function (data) {
        Feng.error("保存失败!" + data.responseJSON.message + "!");
    });
    ajax.set({
        id: $('#id').val(),
        type: 4,
        content: JSON.stringify(content)
    });
    ajax.start();
}
 
 
 
HomeSystemConfigure.showSignRules = function(){
    const str = '<div class="row" id="editorhtml"><div id="editor" type="text/plain" style="height: 500px;"></div></div>';
    layer.open({
        type: 1
        , title: '签到规则说明'
        , area: ['80%', '90%']
        , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
        , id: 'layerDemo' //防止重复弹出
        , content: '<div style="padding: 20px">' + str + '</div>'
        , btn: ['确定', '取消']
        , btnAlign: 'c' //按钮居中
        , shade: 0.5 //不显示遮罩
        , zIndex: -99100
        ,success: function(layero, index){
            if(editor == null){
                editor = UE.getEditor('editor');
                // 手动指定上传文件调用的接口(不同文件类型不同接口)
                UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
                UE.Editor.prototype.getActionUrl = function(action) {
                    // 这里很重要,很重要,很重要,要和配置中的imageActionName值一样
                    if(action == 'uploadimage'){
                        // 这里调用后端我们写的图片上传接口
                        return '/ueditor/uploadImageData';
                    }else if(action == 'uploadfile'){
                        return '/ueditor/uploadFileData';
                    }else{
                        return this._bkGetActionUrl.call(this, action);
                    }
                }
                editorhtml = $('#editorhtml').html();
            }else{
                $('#editorhtml').html(editorhtml);
            }
            // UE.delEditor('editor');   //先删除之前实例的对象
            editor.ready(function () {
                editor.setContent($('#label2').val());
            });
        }
        , yes: function () {
            $('#label2').val(editor.getContent());
            layer.closeAll();
        },
    });
 
}
 
 
 
$(function () {
 
    $('#label3').on('change', function () {
        if($(this).val() == 1){
            $('#label3PreId img').attr('src', Feng.ctxPath + '/static/img/signTypeOne.png');
        }else{
            $('#label3PreId img').attr('src', Feng.ctxPath + '/static/img/signTypeTwo.png');
        }
    })
 
});