You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1124 lines
46 KiB
Plaintext
1124 lines
46 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="cn">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<link href="../Comm/fonts/font-icons.min.css" rel="stylesheet" />
|
|
<title>正在加载请稍候...</title>
|
|
|
|
<script src="../Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
|
|
<!--表单样式-->
|
|
<link href="../Admin/CSS/FoolFrmBody.css" rel="stylesheet" />
|
|
<link href="../../DataUser/Style/FoolFrmStyle/Default.css" rel="stylesheet"/>
|
|
<!-- layui -->
|
|
<link href="../Scripts/layui/layui/css/layui.css" rel="stylesheet" />
|
|
<link href="../Scripts/layui/style/admin.css" rel="stylesheet" />
|
|
<link href="../Scripts/layui/layui/css/autocomplete.css" rel="stylesheet" />
|
|
<script src="../Scripts/layui/layui/layui.js" type="text/javascript"></script>
|
|
<script src="../Scripts/layui/LayuiDialog.js" type="text/javascript"></script>
|
|
<script src="../Scripts/jquery-form.js" type="text/javascript"></script>
|
|
<!--通用的JS-->
|
|
<script src="../Scripts/config.js" type="text/javascript"></script>
|
|
<script src="../Comm/Gener.js" type="text/javascript"></script>
|
|
<script src="../Scripts/QueryString.js" type="text/javascript"></script>
|
|
<script src="./JS/tinymce/tinymce.min.js"></script>
|
|
<script src="JS/jquery.mousewheel.min.js"></script>
|
|
<script src="ChapterFrmGener.js"></script>
|
|
<script src="../Scripts/Tools/jsPdf.debug.js"></script>
|
|
<script src="../Scripts/Tools/html2canvas.js"></script>
|
|
<script src="../../WF/CCForm/FrmFool.js"></script>
|
|
<script src="../../WF/CCForm/FrmEnd.js"></script>
|
|
<script src="../Comm/JScript.js"></script>
|
|
<!--<script src="../../WF/CCForm/FrmGener.js"></script>-->
|
|
<!--<link href="../../DataUser//Style/GloVarsCSS.css" rel="stylesheet" type="text/css"/>-->
|
|
<script language="javascript" type="text/javascript">
|
|
var frmID = null;
|
|
var oid = null;
|
|
var key = null;
|
|
var logInde;
|
|
var eleDom = null;
|
|
var eleOneDom = null;
|
|
let OId = null;
|
|
var nodeRates = null;
|
|
var Tree = null;
|
|
var groupFields = null;
|
|
var attrs = null;
|
|
var treeClick = null;
|
|
var isReadonly = 0; //是否只读?
|
|
var mainTable;//表单数据
|
|
var pageData = {};
|
|
var form = layui.form;
|
|
layui.use(['tree', 'jquery', 'laypage', 'form'], function () {
|
|
var tree = layui.tree, $ = layui.jquery;
|
|
var name = null;
|
|
var treelist = null;
|
|
var Tip = null;
|
|
var Tree_set = null;
|
|
|
|
//页面启动函数.
|
|
$(function () {
|
|
|
|
isReadonly = GetQueryString("IsReadonly");
|
|
if (isReadonly == null) {
|
|
isReadonly = 0;
|
|
pageData.IsReadonly = 0;
|
|
}
|
|
|
|
|
|
frmID = GetQueryString("FrmID");
|
|
if (frmID == null)
|
|
frmID = GetQueryString("FK_MapData");
|
|
if (frmID == null)
|
|
frmID = "Frm_ZhangJieBiaoDAN";
|
|
oid = GetQueryString("OID");
|
|
if (oid == null)
|
|
oid = GetQueryString("WorkID");
|
|
if (oid == null)
|
|
oid = GetQueryString("PKVal");
|
|
|
|
if (oid == null)
|
|
oid = 100;
|
|
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
|
|
handler.AddPara("FrmID", frmID);
|
|
handler.AddPara("OID", oid);
|
|
var data = handler.DoMethodReturnJSON("ChapterFrm_Init");
|
|
console.log(data)
|
|
groupFields = data["GroupFields"];//章.
|
|
attrs = data["Sys_MapAttr"];//节.
|
|
mainTable = data["MainTable"][0];
|
|
|
|
var group = [];
|
|
//形成数据.
|
|
for (var i = 0; i < groupFields.length; i++) {
|
|
var gf = groupFields[i];
|
|
gf.children = [];
|
|
var list = {
|
|
title: gf.Lab,
|
|
id: gf.OID,
|
|
field: gf.Lab,
|
|
children: gf.children,
|
|
attrChildren: [],
|
|
spread: true,
|
|
checked: false,
|
|
...gf
|
|
}
|
|
var n = 0;
|
|
for (var idx = 0; idx < attrs.length; idx++) {
|
|
var attr = attrs[idx];
|
|
if (attr.MyDataType != 1 && list.CtrlType == "")
|
|
continue;
|
|
if (attr.UIVisible == 0)
|
|
continue;
|
|
var clist = {
|
|
title: attr.Name,
|
|
id: attr.KeyOfEn,
|
|
field: attr.Name,
|
|
checked: false,
|
|
Snumber: '',
|
|
...attr
|
|
}
|
|
if (attr.UIContralType == 1) {//如果是下拉框,存储下拉列表值
|
|
if (attr.MyDataType == 2)
|
|
clist.DDLlist = $.grep(data['Sys_Enum'], function (item, index) {
|
|
return item.EnumKey == attr.KeyOfEn;
|
|
});
|
|
else if (attr.MyDataType == 1)
|
|
clist.DDLlist = data[attr.KeyOfEn];
|
|
}
|
|
else if (attr.UIContralType == 3 && attr.MyDataType == 2) {
|
|
clist.DDLlist = $.grep(data['Sys_Enum'], function (item, index) {
|
|
return item.EnumKey == attr.KeyOfEn;
|
|
});
|
|
}
|
|
if (clist.GroupID == list.OID) {
|
|
if (list.CtrlType != "Attr")
|
|
list.children.push(clist)
|
|
else if (list.CtrlType == "Attr") {
|
|
list.attrChildren.push(clist);
|
|
}
|
|
n = n + 1
|
|
clist.Snumber = n;
|
|
}
|
|
|
|
}
|
|
group.push(list)
|
|
}
|
|
console.log(group)
|
|
function tinyInit() {
|
|
tinymce.init({
|
|
selector: '#mytextarea',
|
|
language: 'zh-Hans',
|
|
plugins: [
|
|
'advlist', 'saveBtn',
|
|
'lists', 'image', 'charmap', 'searchreplace', 'visualblocks',
|
|
'table',
|
|
],
|
|
statusbar: false,
|
|
branding: false,
|
|
image_advtab: false,
|
|
image_description: false,
|
|
image_dimensions: false,
|
|
toolbar: 'undo redo | formatpainter casechange blocks | bold italic backcolor | ' +
|
|
'alignleft aligncenter alignright alignjustify | ' +
|
|
'bullist numlist checklist outdent indent | removeformat | saveBtn ',
|
|
images_upload_handler: function (blobInfo) {
|
|
try {
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Comm_Sys");
|
|
handler.AddPara("Files", blobInfo.blob());
|
|
handler.AddPara("FrmID", frmID)
|
|
handler.AddPara("OID", oid)
|
|
var data = handler.DoMethodReturnJSON("RichUploadFile");
|
|
var serverPath = window.location.origin + "/" + data.data
|
|
return Promise.resolve(serverPath)
|
|
} catch (e) {
|
|
return Promise.reject(e)
|
|
}
|
|
},
|
|
paste_data_images: true,
|
|
init_instance_callback: function (editor) {
|
|
editor.on('ExecCommand', function (e) {
|
|
if (e.command === "mceInsertContent") {
|
|
// handleWordPaste()
|
|
// console.log(e)
|
|
if (e.value.content.includes("file:///")) {
|
|
layer.msg("检测到本地文件,请右键图片替换")
|
|
}
|
|
}
|
|
|
|
});
|
|
var sdata = ChapterFrmShow(key);
|
|
editor.setContent(sdata);
|
|
},
|
|
});
|
|
}
|
|
|
|
function iframeFun(id, url, OId, item) {
|
|
var myframe = document.getElementById(id).contentWindow;
|
|
if (myframe.Save != undefined) {
|
|
myframe.Save();
|
|
CheckGroupFieldStr(OId, item);
|
|
}
|
|
if (myframe.SaveAll != undefined) {
|
|
myframe.SaveAll();
|
|
CheckGroupFieldStr(OId, item);
|
|
}
|
|
$("#toIframe").show();
|
|
$("#toIframe").attr("src", url);
|
|
$("#textRea").hide();
|
|
$("#CCForm").hide();
|
|
}
|
|
|
|
// tree 点击事件
|
|
treeClick = (obj) => {
|
|
$('.layui-tree-set').removeClass("tree-txt-active");
|
|
if (!obj.data.children) {
|
|
tinyInit();
|
|
$("#toIframe").hide();
|
|
$("#CCForm").hide();
|
|
$("#textRea").show();
|
|
if (name !== obj.data.Name) {
|
|
Tip = obj.data.Tip;
|
|
name = obj.data.Name;
|
|
$("#Title").html(name);
|
|
getContent(obj.data.KeyOfEn);
|
|
eleDom = $(obj.elem[0]).find(".rate");
|
|
}
|
|
$(obj.elem[0]).addClass("tree-txt-active");
|
|
Savetab(OId, eleOneDom)
|
|
|
|
} else {
|
|
getContent(key);
|
|
var url = '';
|
|
//如果点击章.
|
|
if (obj.data.CtrlType == "Dtl") {
|
|
url = Ele_Dtl(obj.data.CtrlID);
|
|
|
|
}
|
|
if (obj.data.CtrlType == "Attr") {
|
|
var attrhtm = "";
|
|
attrhtm += '<div id="Group_' + obj.data.OID + '">';
|
|
attrhtm += InitMapAttr(data, 4, obj.data.OID);
|
|
attrhtm += '</div>';
|
|
attrhtm += '<div class="layui-form-item">';
|
|
attrhtm += '<div class="layui-input-block">';
|
|
attrhtm += '<button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>';
|
|
attrhtm += '</div></div>';
|
|
|
|
$("#CCForm").html(attrhtm);
|
|
//3.装载表单数据与修改表单元素风格.
|
|
LoadFrmDataAndChangeEleStyle(data);
|
|
|
|
form.render();
|
|
form.render('checkbox');
|
|
//4.解析表单的扩展功能
|
|
AfterBindEn_DealMapExt(data);
|
|
$.each($(".ccdate"), function (i, item) {
|
|
var format = $(item).attr("data-info");
|
|
var type = $(item).attr("data-type");
|
|
if (format.indexOf("HH") != -1) {
|
|
layui.laydate.render({
|
|
elem: '#' + item.id,
|
|
format: $(item).attr("data-info"), //可任意组合
|
|
type: type,
|
|
trigger: 'click',
|
|
ready: function (date) {
|
|
var now = new Date();
|
|
var mm = "";
|
|
if (now.getMinutes() < 10)
|
|
mm = "0" + now.getMinutes();
|
|
else
|
|
mm = now.getMinutes();
|
|
|
|
var ss = "";
|
|
if (now.getSeconds() < 10)
|
|
ss = "0" + now.getSeconds();
|
|
else
|
|
ss = now.getSeconds();
|
|
|
|
this.dateTime.hours = now.getHours();
|
|
this.dateTime.minutes = mm;
|
|
this.dateTime.seconds = ss;
|
|
},
|
|
change: function (value, date, endDate) {
|
|
$('.laydate-btns-confirm').click();
|
|
},
|
|
done: function (value, date, endDate) {
|
|
var data = $(this.elem).data();
|
|
$(this.elem).val(value);
|
|
if (data && data.ReqDay != null && data.ReqDay != undefined)
|
|
ReqDays(data.ReqDay);
|
|
}
|
|
});
|
|
} else {
|
|
layui.laydate.render({
|
|
elem: '#' + item.id,
|
|
format: $(item).attr("data-info"), //可任意组合
|
|
type: type,
|
|
done: function (value, date, endDate) {
|
|
var data = $(this.elem).data();
|
|
$(this.elem).val(value);
|
|
if (data && data.ReqDay != null && data.ReqDay != undefined)
|
|
ReqDays(data.ReqDay);
|
|
}
|
|
});
|
|
}
|
|
|
|
})
|
|
form.on('submit(formDemo)', function (data) {
|
|
//正在保存弹出层
|
|
var index = layer.msg('正在保存,请稍后..', {
|
|
icon: 16
|
|
, shade: 0.01
|
|
});
|
|
if (checkBlanks() == false) {
|
|
layer.alert("必填项不能为空");
|
|
return false;
|
|
}
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
|
|
handler.AddPara("FrmID", frmID);
|
|
handler.AddPara("OID", oid);
|
|
var keys = Object.keys(data.field);
|
|
keys.forEach((item) => {
|
|
var keyOfEn = item.split("_")[1];
|
|
if (mainTable[keyOfEn] != data.field[item]) {//防抖
|
|
handler.AddPara("KeyOfEn", keyOfEn);
|
|
handler.AddPara("Vals", data.field[item]);
|
|
var dataRes = handler.DoMethodReturnString("ChapterFrm_SaveOneField");
|
|
if (dataRes.indexOf("err@") != -1) {
|
|
layer.alert(data);
|
|
layer.close(index);
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
layer.close(index);
|
|
layer.alert("数据保存成功");
|
|
return false;
|
|
});
|
|
$("#toIframe").hide();
|
|
$("#textRea").hide();
|
|
$("#CCForm").show();
|
|
|
|
}
|
|
|
|
if (obj.data.CtrlType == "Ath") {
|
|
url = basePath + "/WF/CCForm/Ath.htm?1=1&AthPK=" + obj.data.CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
}
|
|
|
|
if (obj.data.CtrlType == "ChapterFrmLinkFrm") {
|
|
url = basePath + "/WF/CCForm/Frm.htm?1=1&FrmID=" + obj.data.CtrlID + "&OID=" + oid + "&FK_MapData=" + obj.data.CtrlID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
|
|
}
|
|
|
|
if (obj.data.CtrlType == "ChapterFrmSelfUrl") {
|
|
if (obj.data.CtrlID.indexOf('http') == 0)
|
|
url = obj.data.CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
else
|
|
url = basePath + "" + obj.data.CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
|
|
}
|
|
if (obj.data.CtrlType == '') {
|
|
return;
|
|
}
|
|
|
|
|
|
eleOneDom = obj.elem;
|
|
OId = obj.data.OID;
|
|
if (obj.data.CtrlType != "Attr")
|
|
iframeFun("toIframe", url, OId, eleOneDom);
|
|
$('.layui-tree-set').removeClass("tree-txt-active");
|
|
$(obj.elem[0]).addClass("tree-txt-active");
|
|
}
|
|
}
|
|
|
|
Tree = tree.render({
|
|
elem: '#test1',
|
|
data: group,
|
|
id: 'treeId',
|
|
click: function (obj) {
|
|
treeClick(obj)
|
|
}
|
|
});
|
|
|
|
// 判断第一项是否有子集 并选中状态 跳转iframe页面
|
|
function treeSet() {
|
|
treelist = document.querySelectorAll('.layui-tree-pack >.layui-tree-set');
|
|
treelist.forEach((item, index) => {
|
|
var main = $(item).find('.layui-tree-txt');
|
|
var hm = `<span>(${index + 1}) </span>`;
|
|
$(main).before(hm);
|
|
$(item).find('.layui-tree-iconClick').hide();
|
|
db.push({
|
|
"attrKey": item.dataset.id,
|
|
"vals": '',
|
|
});
|
|
|
|
})
|
|
Tree_set = document.querySelectorAll('.layui-tree>.layui-tree-set');
|
|
Tree_set.forEach((item, index) => {
|
|
$(item).attr("title", group[index].title);
|
|
$(item).attr("id", "Pnode" + group[index].OID);
|
|
|
|
var main = $(item).find('.layui-tree-pack ');
|
|
var h = `<i class="icon-check rate"></i>`;
|
|
$(item).find(".layui-tree-main").append(h);
|
|
//替换 tree icon
|
|
if (item.childNodes.length == 1) {
|
|
var sclass = $(item).find('.layui-tree-iconClick');
|
|
$(sclass).empty();
|
|
if (group[index].CtrlType == "Dtl") {
|
|
// let i = `<i class="icon-notebook"></i>`
|
|
let i = `<i class="icon-folder"></i>`
|
|
$(sclass).html(i);
|
|
}
|
|
|
|
if (group[index].CtrlType == "Ath") {
|
|
let i = `<i class="icon-paper-clip"></i>`
|
|
$(sclass).html(i);
|
|
}
|
|
|
|
if (group[index].CtrlType == "ChapterFrmLinkFrm") {
|
|
let i = `<i class="icon-folder"></i>`
|
|
$(sclass).html(i);
|
|
}
|
|
|
|
if (group[index].CtrlType == "ChapterFrmSelfUrl") {
|
|
let i = `<i class="icon-folder"></i>`
|
|
$(sclass).html(i);
|
|
}
|
|
} else {
|
|
var sclass = $(item).find('.layui-tree-iconClick');
|
|
$(sclass).empty();
|
|
$(sclass).removeClass("layui-tree-icon")
|
|
let i = `<i class="icon-folder"></i>`
|
|
$(sclass).html(i);
|
|
}
|
|
//默认第一个选中
|
|
if (index == 0) {
|
|
if (main.length == 0) {
|
|
$('.layui-tree-set').removeClass("tree-txt-active");
|
|
$(item).addClass("tree-txt-active");
|
|
var url = '';
|
|
//如果点击章.
|
|
if (group[index].CtrlType == "Dtl") {
|
|
url = Ele_Dtl(group[index].CtrlID);
|
|
}
|
|
|
|
if (group[index].CtrlType == "Ath") {
|
|
url = basePath + "/WF/CCForm/Ath.htm?1=1&AthPK=" + group[index].CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
}
|
|
|
|
if (group[index].CtrlType == "ChapterFrmLinkFrm") {
|
|
url = basePath + "/WF/CCForm/Frm.htm?1=1&FrmID=" + group[index].CtrlID + "&OID=" + oid + "&FK_MapData=" + group[index].CtrlID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
}
|
|
|
|
if (group[index].CtrlType == "ChapterFrmSelfUrl") {
|
|
if (group[index].CtrlID.indexOf('http') == 0)
|
|
url = group[index].CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
else
|
|
url = basePath + "" + group[index].CtrlID + "&OID=" + oid + "&FK_MapData=" + frmID + "&FK_Node=" + GetQueryString("FK_Node");
|
|
}
|
|
if (group[index].CtrlType == '') {
|
|
return;
|
|
}
|
|
eleOneDom = item;
|
|
OId = group[index].OID;
|
|
iframeFun("toIframe", url, OId, eleOneDom);
|
|
} else {
|
|
item.checked = true;
|
|
item.children[index].checked = true;
|
|
key = item.children[index].KeyOfEn;
|
|
tinyInit();
|
|
treelist[index].classList.add("tree-txt-active");
|
|
name = group[index].children[index].Name;
|
|
$("#Title").html(name)
|
|
getContent(treelist[index].dataset.id);
|
|
Tip = group[index].children[index].Tip;
|
|
eleDom = $(treelist[index]).find(".rate");
|
|
}
|
|
}
|
|
})
|
|
showType(group, Tree_set)
|
|
|
|
}
|
|
|
|
treeSet();
|
|
$("#tips").click(function () {
|
|
openDialog(Tip, key);
|
|
})
|
|
IsAtPara(attrs, treelist);
|
|
IsAtParaKey(group, Tree_set);
|
|
var isShows = true;
|
|
$("#menu").toggle();
|
|
$("#menuShow").click(function () {
|
|
$("#menu").toggle();
|
|
if (isShows) {
|
|
$("#scrollDiv").addClass("Card_body")
|
|
isShows = false
|
|
} else {
|
|
$("#scrollDiv").removeClass("Card_body")
|
|
isShows = true
|
|
}
|
|
|
|
})
|
|
|
|
$("#scrollDiv").on("mousewheel", function (event, delta) {
|
|
console.log(event)
|
|
console.log(delta)
|
|
event.preventDefault();
|
|
if (delta > 0) {
|
|
tabChange("up")
|
|
} else {
|
|
tabChange("down")
|
|
}
|
|
return false;
|
|
});
|
|
|
|
//监听滚动条事件
|
|
ArcScorll("#toIframe")
|
|
//setTimeout(ArcScorll('#mytextarea_ifr'), 3000)
|
|
});
|
|
|
|
function showType(group, Tree_set) {
|
|
console.log(Tree_set)
|
|
let n = 0;
|
|
group.forEach((item, index) => {
|
|
if (item.ShowType == 2) {
|
|
n = n + 1;
|
|
const Id = Tree_set[index].dataset.id;
|
|
console.log($(`#Pnode${Id}`))
|
|
$(`#Pnode${Id}`).hide()
|
|
}
|
|
})
|
|
if (n == group.length) {
|
|
$("#menuShow").hide()
|
|
}
|
|
}
|
|
// 解析
|
|
function analysis(Tip) {
|
|
let tipArr = Tip.split("@");
|
|
let tempul = `<ul class="tipsul">
|
|
${tipArr.map(item => {
|
|
if (item.includes('###')) {
|
|
return `<li class="m-1"><h3>${item.split("###").join('')}</h3></li>`
|
|
} else if (item.includes(')')) {
|
|
return `<li class="m-1"><small>${item.split("###").join('')}</small></li>`
|
|
} else {
|
|
return `<li class="m-1">${item.split("###").join('')}</li>`
|
|
}
|
|
|
|
}).join('')}
|
|
</ul>`
|
|
Tip = tempul;
|
|
return Tip;
|
|
}
|
|
|
|
tinymce.PluginManager.add('saveBtn', function (editor, url) {
|
|
// 注册一个保存按钮名称
|
|
editor.ui.registry.addButton("saveBtn", {
|
|
text: '保存',
|
|
icon: 'save',
|
|
onAction: function () {
|
|
var vals = tinymce.activeEditor.getContent();
|
|
if (key == undefined || key == '') {
|
|
layer.msg('请先选择子节点', { icon: 6 });
|
|
return;
|
|
} else {
|
|
ChapterFrmSave(key, vals)
|
|
}
|
|
}
|
|
})
|
|
});
|
|
tinymce.PluginManager.add('helpBtn', function (editor, url) {
|
|
editor.ui.registry.addButton('helpBtn', {
|
|
text: '提示',
|
|
icon: 'help',
|
|
onAction: function () {
|
|
openDialog(editor);
|
|
}
|
|
});
|
|
});
|
|
|
|
var keylist = [];
|
|
function IsAtPara(attrs, list) {
|
|
attrs.forEach(item => {
|
|
if (item.AtPara != null && item.AtPara != "") {
|
|
if (item.AtPara.includes('@IsStar')) {
|
|
keylist.push(item.KeyOfEn);
|
|
}
|
|
}
|
|
|
|
})
|
|
showRate(list)
|
|
}
|
|
function showRate(list) {
|
|
list.forEach(item => {
|
|
var keyId = $(item).data("id");
|
|
if (keylist.includes(keyId)) {
|
|
var rate = $(item).find(".rate");
|
|
$(rate).show()
|
|
}
|
|
})
|
|
|
|
}
|
|
var Kylist = [];
|
|
function IsAtParaKey(attr, list) {
|
|
attr.forEach(item => {
|
|
if (item.AtPara != null) {
|
|
if (item.AtPara.includes('@IsStar')) {
|
|
Kylist.push(item.title);
|
|
}
|
|
}
|
|
|
|
})
|
|
keyshowRate(list)
|
|
}
|
|
function keyshowRate(list) {
|
|
list.forEach(item => {
|
|
var title = item.title;
|
|
if (Kylist.includes(title)) {
|
|
if (item.children.length == 1) {
|
|
var rate = $(item).find(".rate");
|
|
$(rate).show()
|
|
} else {
|
|
console.log(item)
|
|
var rate = $(item.children[0]).find(".rate");
|
|
$(rate).show()
|
|
}
|
|
|
|
|
|
}
|
|
})
|
|
|
|
}
|
|
function openDialog(tip, keyOfEn) {
|
|
if (tip == null || tip == '') {
|
|
var mypk = "FieldNameLink_" + frmID + "_" + keyOfEn;
|
|
var mapExt = new Entity("BP.Sys.MapExt");
|
|
mapExt.MyPK = mypk;
|
|
var i = mapExt.RetrieveFromDBSources();
|
|
if (i == 0) {
|
|
alert('没有设置帮助.');
|
|
return;
|
|
}
|
|
tip = TransbrString(mapExt.Doc);
|
|
var tips = `<div style="padding:30px">${tip}</div>`;
|
|
layer.open({
|
|
type: 1,
|
|
title: '填报提示',
|
|
area: ['1000px', '400px'],
|
|
shade: 0.4,
|
|
content: tips,
|
|
|
|
})
|
|
} else {
|
|
tip = analysis(tip);
|
|
var tips = `${tip}`;
|
|
layer.open({
|
|
type: 1,
|
|
title: '填报提示',
|
|
area: ['500px', '300px'],
|
|
shade: 0.4,
|
|
content: tips,
|
|
|
|
})
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//获得从表的url.
|
|
function Ele_Dtl(frmID) {
|
|
var frmDtl = new Entity("BP.Sys.MapDtl", frmID);
|
|
var src = "";
|
|
var href = GetHrefUrl();
|
|
var urlParam = href.substring(href.indexOf('?') + 1, href.length);
|
|
urlParam = urlParam.replace('&DoType=', '&DoTypeDel=xx');
|
|
|
|
var ensName = frmDtl.No;
|
|
if (ensName == undefined) {
|
|
layer.alert('系统错误,请找管理员联系');
|
|
return;
|
|
}
|
|
|
|
var currentURL = GetHrefUrl();
|
|
|
|
var baseUrl = "./";
|
|
if (currentURL.indexOf("AdminFrm.htm") != -1)
|
|
baseUrl = "../../CCForm/";
|
|
if (currentURL.indexOf("MyBill.htm") != -1 || currentURL.indexOf("MyDict.htm") != -1)
|
|
baseUrl = "../CCForm/";
|
|
if (currentURL.indexOf("FrmGener.htm") != -1 || currentURL.indexOf("FrmDBVer.htm") != -1 || currentURL.indexOf("DtlFrm.htm") != -1)
|
|
baseUrl = "./";
|
|
|
|
//表格模式
|
|
if (frmDtl.ListShowModel == "0")
|
|
src = baseUrl + "Dtl2017.htm?1=1";
|
|
if (frmDtl.ListShowModel == "1")
|
|
src = baseUrl + "DtlCard.htm?1=1";
|
|
if (frmDtl.ListShowModel == "2") {
|
|
if (frmDtl.UrlDtl == null || frmDtl.UrlDtl == undefined || frmDtl.UrlDtl == "")
|
|
return "从表" + frmDtl.Name + "没有设置URL,请在" + frmDtl.FK_MapData + "_Self.js中解析";
|
|
src = basePath + "/" + frmDtl.UrlDtl;
|
|
if (src.indexOf("?") == -1)
|
|
src += "?1=1";
|
|
}
|
|
|
|
src += "&IsShowVerBtn=1&EnsName=" + frmDtl.No + "&RefPKVal=" + oid + "&FK_MapData=" + frmID + "&IsReadonly=" + (isReadonly == true ? 1 : 0) + "&" + urlParam + "&Version=1&FrmType=0";
|
|
return src;
|
|
}
|
|
|
|
var currData = null;
|
|
|
|
function ChapterFrmShow(attrKey) {
|
|
if (attrKey == null || attrKey == "") {
|
|
//alert("字段值为空.");
|
|
return;
|
|
}
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
|
|
handler.AddPara("FrmID", frmID);
|
|
handler.AddPara("OID", oid);
|
|
handler.AddPara("KeyOfEn", attrKey);
|
|
var data = handler.DoMethodReturnString("ChapterFrm_InitOneField");
|
|
// tinymce.activeEditor.setContent(data)
|
|
currData = data; //记录当前的变量.
|
|
return data;
|
|
|
|
}
|
|
/**
|
|
* 节的数据保存..
|
|
* @param attrKey
|
|
* @param vals
|
|
*/
|
|
function ChapterFrmSave(attrKey, vals) {
|
|
if (attrKey == null || attrKey == "") {
|
|
return;
|
|
}
|
|
|
|
//if (vals == currData) return;
|
|
|
|
var oldVal = getOldVal(attrKey);
|
|
|
|
//判断内存的值是否更新
|
|
var oldvals = TransferString(oldVal.vals);
|
|
if (Object.is(vals, oldvals))
|
|
return; //数据没有变化.
|
|
|
|
var loading = layer.msg('正在保存中', { icon: 16, shade: 0.3 });
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
|
|
handler.AddPara("FrmID", frmID);
|
|
handler.AddPara("OID", oid);
|
|
handler.AddPara("KeyOfEn", attrKey);
|
|
handler.AddPara("Vals", vals);
|
|
const data = handler.DoMethodReturnString("ChapterFrm_SaveOneField");
|
|
if (data.indexOf('err@') == 0) {
|
|
alert(data);
|
|
return;
|
|
}
|
|
|
|
console.log(data);
|
|
if (data == "1") {
|
|
$(eleDom).show(); //显示star.
|
|
} else {
|
|
$(eleDom).hide(); //隐藏star.
|
|
}
|
|
|
|
layer.close(loading);
|
|
// 更新内存的值.
|
|
changeDBval(vals, attrKey);
|
|
|
|
//设置父级star.
|
|
SetParentStar(attrKey);
|
|
}
|
|
function SetParentStar(attrKey) {
|
|
var groupID = null;
|
|
for (var i = 0; i < attrs.length; i++) {
|
|
var attr = attrs[i];
|
|
if (attr.KeyOfEn == attrKey) {
|
|
groupID = attr.GroupID;
|
|
break;
|
|
}
|
|
}
|
|
var PraEle = $(`#Pnode${groupID}>.layui-tree-entry`);
|
|
var raEle = $(PraEle).find(".rate");
|
|
var pack = $(`#Pnode${groupID}>.layui-tree-pack`);
|
|
nodeRates = $(pack).find(".rate");
|
|
//获得节点集合.
|
|
var isHaveBlank = false;
|
|
var listnode = [];
|
|
for (var i = 0; i < nodeRates.length; i++) {
|
|
var BleaStr = nodeRates[i].style.display == "inline";
|
|
if (BleaStr) {
|
|
listnode.push(nodeRates[i])
|
|
}
|
|
}
|
|
if (listnode.length !== nodeRates.length) {
|
|
isHaveBlank = true;
|
|
}
|
|
//给父节点加star.
|
|
|
|
if (isHaveBlank == false) {
|
|
$(raEle).show();
|
|
} else {
|
|
$(raEle).hide();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#View').click(function () {
|
|
if (key == undefined || key == '') {
|
|
layer.msg('请先选择子节点', { icon: 6 });
|
|
return;
|
|
} else {
|
|
var url = "ChapterFrmView.htm?FrmID=" + frmID + "&OID=" + oid + "&attrKey=" + key;
|
|
// WinOpenFull(url);
|
|
OpenLayuiDialog(url, '', '1200', '', '', false)
|
|
}
|
|
|
|
})
|
|
|
|
$('#Exp').click(function () {
|
|
var url = "ChapterFrmExp.htm?FrmID=" + frmID + "&OID=" + oid + "&attrKey=" + key;
|
|
// WinOpenFull(url);
|
|
OpenLayuiDialog(url, '', '1200', '', '', false);
|
|
layer.load(0, {
|
|
shade: [0.6, '#fff'],
|
|
content: '下载中...',
|
|
success: function (layero) {
|
|
layero.find('.layui-layer-content').css({
|
|
'padding-top': '35px',
|
|
'text-align': 'center',
|
|
'z-index': '19891016'
|
|
});
|
|
}
|
|
});
|
|
})
|
|
|
|
function getContent(KeyOfEn) {
|
|
//var cdata = ChapterFrmShow(KeyOfEn);
|
|
//changeDBval(cdata, KeyOfEn);
|
|
//var Cdata = tinymce.activeEditor.getContent();
|
|
//ChapterFrmSave(key, Cdata);
|
|
//key = KeyOfEn;
|
|
//var Data = ChapterFrmShow(key);
|
|
//tinymce.activeEditor.setContent(Data);
|
|
var cdata = ChapterFrmShow(KeyOfEn);
|
|
changeDBval(cdata, KeyOfEn);
|
|
var Cdata = '';
|
|
if (tinymce.activeEditor !== null) {
|
|
Cdata = tinymce.activeEditor.getContent();
|
|
}
|
|
ChapterFrmSave(key, Cdata);
|
|
key = KeyOfEn;
|
|
var Data = ChapterFrmShow(key);
|
|
if (tinymce.activeEditor !== null) {
|
|
tinymce.activeEditor.setContent(Data);
|
|
|
|
}
|
|
// setTimeout(ArcScorll('#mytextarea_ifr'), 3000)
|
|
}
|
|
|
|
//保存当前打开的最后一个章节方法
|
|
function Savetab(OId, eleOneDom) {
|
|
console.log(eleOneDom);
|
|
var iframe = $("#toIframe");
|
|
//IFrame的内容
|
|
if (iframe.is(":hidden") == true) {
|
|
var myframe = iframe[0].contentWindow;
|
|
if (myframe && myframe.Save != undefined && typeof (myframe.Save) == "function") {
|
|
var flag = myframe.Save();
|
|
CheckGroupFieldStr(OId, eleOneDom)
|
|
if (flag == false)
|
|
return false;
|
|
}
|
|
if (myframe && myframe.SaveAll != undefined && typeof (myframe.SaveAll) == "function") {
|
|
myframe.SaveAll();
|
|
CheckGroupFieldStr(OId, eleOneDom)
|
|
return true;
|
|
}
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
});
|
|
//保存当前打开的最后一个章节
|
|
function Save() {
|
|
var textA = $("#textRea");
|
|
var iframe = $("#toIframe");
|
|
var ccForm = $("#CCForm");
|
|
//保存富文本框的内容
|
|
if (textA.is(":hidden") == false) {
|
|
var cdata = tinymce.activeEditor.getContent();
|
|
if (key == null || key == "") {
|
|
return;
|
|
}
|
|
var handler = new HttpHandler("BP.WF.HttpHandler.WF_CCForm");
|
|
handler.AddPara("FrmID", frmID);
|
|
handler.AddPara("OID", oid);
|
|
handler.AddPara("KeyOfEn", key);
|
|
handler.AddPara("Vals", cdata);
|
|
handler.DoMethodReturnString("ChapterFrm_SaveOneField");
|
|
return;
|
|
|
|
}
|
|
//IFrame的内容
|
|
if (iframe.is(":hidden") == false) {
|
|
var myframe = iframe[0].contentWindow;
|
|
if (myframe && myframe.Save != undefined && typeof (myframe.Save) == "function") {
|
|
var flag = myframe.Save();
|
|
if (flag == false)
|
|
return false;
|
|
}
|
|
if (myframe && myframe.SaveAll != undefined && typeof (myframe.SaveAll) == "function") {
|
|
myframe.SaveAll();
|
|
return true;
|
|
}
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
html, body {
|
|
height: 100%;
|
|
}
|
|
|
|
.app {
|
|
height: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
}
|
|
|
|
.border_1 {
|
|
border: 1px solid #ccc;
|
|
height: 100%;
|
|
}
|
|
|
|
.padding-5 {
|
|
padding: 10px;
|
|
}
|
|
|
|
|
|
.tree-txt-active {
|
|
background: #dcdcdc;
|
|
}
|
|
|
|
.layui-tree-entry .layui-tree-txt {
|
|
font-weight: 600;
|
|
}
|
|
|
|
.layui-tree-pack .layui-tree-txt {
|
|
font-weight: 300;
|
|
}
|
|
|
|
.layui-tab-title {
|
|
text-align: center
|
|
}
|
|
|
|
.layui-tab-content {
|
|
padding: 0;
|
|
}
|
|
|
|
.h-100 {
|
|
height: 100vh;
|
|
overflow: auto;
|
|
}
|
|
|
|
#textRea {
|
|
height: 100%;
|
|
}
|
|
|
|
#toIframe {
|
|
display: none;
|
|
width: 100%;
|
|
border: none;
|
|
height: 100vh !important;
|
|
}
|
|
|
|
.tipsul {
|
|
padding: 20px;
|
|
}
|
|
|
|
.tipsul h3 {
|
|
font-weight: bold !important;
|
|
margin-bottom: 5px !important;
|
|
}
|
|
|
|
.tipsul li {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.tipsul small {
|
|
font-size: 16px !important;
|
|
margin-left: 20px !important;
|
|
}
|
|
|
|
.labelTitle {
|
|
height: 40px;
|
|
text-align: center;
|
|
padding-right: 28px;
|
|
line-height: 40px;
|
|
background: #fff;
|
|
}
|
|
|
|
.labelTitle #Title {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.layui-right {
|
|
float: right;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.layui-row {
|
|
/*height: 100vh;*/
|
|
}
|
|
|
|
.tox-tinymce {
|
|
height: calc(100% - 40px) !important;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
border-radius: 10px;
|
|
-webkit-box-shadow: inset 0 0 6px #999;
|
|
background-color: #999;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
-webkit-box-shadow: inset 0 0 6px #ddd;
|
|
border-radius: 10px;
|
|
background-color: #F5F5F5;
|
|
}
|
|
|
|
::-webkit-scrollbar {
|
|
width: 4px;
|
|
height: 0px;
|
|
background-color: #F5F5F5;
|
|
}
|
|
|
|
.rate {
|
|
color: green;
|
|
font-size: 12px;
|
|
display: none;
|
|
margin-left: 5px;
|
|
}
|
|
|
|
#menu {
|
|
display: none;
|
|
width: 30%;
|
|
}
|
|
|
|
#scrollDiv {
|
|
width: 100%
|
|
}
|
|
|
|
.Card_body {
|
|
width: 70%;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="layui-row app">
|
|
<div id="menu" data-anim="layui-anim-downbit">
|
|
<div class="layui-tab layui-tab-brief" lay-filter="docTabBrief">
|
|
<!--<div class="layui-tab-title">
|
|
<button class="layui-btn layui-btn-primary layui-btn-sm" onclick="tabChange('up')">上一节</button>
|
|
<button class="layui-btn layui-btn-primary layui-btn-sm" onclick="tabChange('down')">下一节</button>
|
|
</div>-->
|
|
<div class="layui-tab-content">
|
|
<div class="layui-tab-item layui-show">
|
|
<div id="test1" class="demo-tree demo-tree-box" style="height: calc(100vh - 30px); overflow-x: auto "></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="h-100" id="scrollDiv" style="overflow-y:hidden">
|
|
<div class="layui-tab-title" style="display:flex;justify-content:end;background:#fff">
|
|
<div id="elemPage"></div>
|
|
<button class="layui-btn layui-btn-primary layui-btn-sm" id="menuShow">目录</button>
|
|
<button class="layui-btn layui-btn-primary layui-btn-sm" onclick="tabChange('up')">上一节</button>
|
|
<button class="layui-btn layui-btn-primary layui-btn-sm" onclick="tabChange('down')">下一节</button>
|
|
</div>
|
|
<div class="layui-form" id="textRea">
|
|
<div class="labelTitle">
|
|
<span id="Title"></span>
|
|
<button class="layui-right layui-btn layui-btn-sm" id="tips">填报提示</button>
|
|
</div>
|
|
<textarea id="mytextarea"></textarea>
|
|
</div>
|
|
<div class="layui-form">
|
|
<iframe id="toIframe" frameborder="0" style="width:100%;height:100%"></iframe>
|
|
</div>
|
|
<!--表单内部信息-->
|
|
<div class="layui-fluid fluid" style="padding-top:65px">
|
|
<div class="layui-row layui-col-space15" id="ContentDiv">
|
|
<!-- 内容主体区域 -->
|
|
<div class="layui-col-md12">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div id="CCForm" class="layui-form">
|
|
<!--加载表单的信息-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
</html> |