/**
|
* 角色管理的单例
|
*/
|
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');
|
}
|
})
|
|
});
|