let form, laydate, layer;
let objParams = {};
function setParams(obj) {
objParams = JSON.parse(obj);
layui.use(["form", 'layer'], function () {
form = layui.form;
layer = layui.layer;
form.on('radio', function (data) {
if (data.value === '1') {
if ($('#measures').length === 0) {
setMeasures();
}
} else {
$('#measures').remove();
}
});
form.on('submit(formData)', function (data) {
submitApply(data);
});
layui.form.render();
});
$('.content-info').eq(0).append('
' + objParams.warnTime + '
');
$('.content-info').eq(1).append('' + objParams.content + '
');
$('.content-info').eq(2).append('' + objParams.warnContent + '
');
$('#img-show').find('img').attr('src', objParams.path);
}
function setMeasures() {
let html = '' +
'
' +
'
' +
'' +
'
' +
'
';
$('#statusItem').after(html);
}
function saveData2() {
$('#formSubmit').trigger('click')
}
// 保存数据
function submitApply(data) {
/* let field = data.field; // 获取表单字段值
const url = commonUrl + "screen/largeScreen/personnelControl/addNewFence";
let encryptStr = encryptCBC(JSON.stringify(field));
let loadingMsg = layer.msg('正在提交保存,请稍等...', {
icon: 16,
shade: 0.01,
time: '0'
});
ajaxRequest(url, "POST", encryptStr, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
parent.layer.msg(result.msg, { icon: 1, offset: 't' });
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
} else if (result.code === 401) {
loginout(1)
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
error(xhr)
}, "application/json", aqEnnable); */
closePage(1);
}
// 关闭页面
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
if (type == 1) {
window.parent.changeData();
}
parent.layer.close(index); // 再执行关闭
}