diff --git a/apps/_bpm.platform/ui/dict/treedictionary/js/console.m.ui.design.dict.treedictionary.runtime.js b/apps/_bpm.platform/ui/dict/treedictionary/js/console.m.ui.design.dict.treedictionary.runtime.js
new file mode 100644
index 00000000..464a9784
--- /dev/null
+++ b/apps/_bpm.platform/ui/dict/treedictionary/js/console.m.ui.design.dict.treedictionary.runtime.js
@@ -0,0 +1,1023 @@
+$(document).ready(function () {
+ initTree();
+ awsui.parse();
+ $(".tablecont").height($(window).height() - $(".sousuo").outerHeight() - 40);
+ if (config.multiselect) {
+ } else {
+ $("#selectTd").hide();
+ }
+ $("#buttonedit").width($(window).width() - 30);
+ $("#buttonedit").buttonedit({
+ iconCls: "forms-icon search",
+ onClick: function () {
+ if ($("#buttonedit").val() == "") {
+ return;
+ }
+ $.simpleAlert(正在加载 + ".....", "loading");
+ // 单击事件
+ searchDictByName();
+ }
+ });
+ // 回车事件
+ $('#buttonedit').keydown(function (e) {
+ if (e.keyCode == 13) {
+ if ($("#buttonedit").val() == "") {
+ return;
+ }
+ $.simpleAlert(正在加载 + ".....", "loading");
+ searchDictByName();
+ }
+ });
+});
+var searchArray = [];
+
+function searchDictByName() {
+ var val = $("#buttonedit").val();
+ if (val == "") {
+ return;
+ }
+ // if (config.dictKey != null) {
+ // searcherDict(val);
+ // return;
+ // }
+ // 判断是否有 $公式
+ if (config.rootSqlcascade) {
+ var cascadeData = [];
+ var cascadeFieldList = config.rootSqlcascade;
+ for (var item in cascadeFieldList) {
+ var fieldName = cascadeFieldList[item];
+ var cascadeFieldVal = '';
+ if ($("#" + fieldName).length > 0) {
+ cascadeFieldVal = $('#' + fieldName, parent.document).val();
+ }
+ var obj = {
+ cascadeField: cascadeFieldList[item],
+ cascadeFieldVal: cascadeFieldVal
+ }
+ cascadeData.push(obj);
+ }
+ config.cascadeData = cascadeData;
+ }
+ config.searchValue = val;
+ var params = {
+ config: BASE64.encoder(escape(JSON.stringify(config))),
+ boItemName: boItemName,
+ sid: $("#sid").val(),
+ formData: awsui.encode(formData),
+ rowData: awsui.encode(rowData),
+ cmd: 'CLIENT_UI_TREEDICTIONARY_FILLBACK_SEARCHERDATA'
+ };
+ var p = {
+ type: "POST",
+ url: "./jd",
+ data: params,
+ dataType: "json",
+ alert: false,
+ success: function (r) {
+ $.simpleAlert("close");
+ if (r.result == "ok") {
+ $("#dictionaryTree").hide();
+ $("#back").show();
+ searchArray = r.data.array;
+ // alert(JSON.stringify(searchArray));
+ if (config.searchShow == "tree") {
+ buildSearchTree(searchArray);
+ } else {
+ getHtml();
+ }
+ }
+ }
+ };
+ awsui.ajax.request(p);
+ config.searchValue = null;
+}
+
+function buildSearchTree(datas) {
+ var rebuildDatas = [];
+ dictionaryTree.isSearching = true;
+ var rootDatas = dictionaryTree.getRootNode();
+ for (var i = 0, size_i = rootDatas.length; i < size_i; i++) {
+ var allDatum = rootDatas[i];
+ allDatum.open = true;
+ rebuildDatas.push(allDatum);
+ var count = 0;
+ for (var j = 0, size_j = datas.length; j < size_j; j++) {
+ var datum = datas[j];
+ if (datum.pId == allDatum.id) {
+ count++;
+ datum.pid = datum.pId;
+ datum.id = datum.dId;
+ if (!datum.isLeaf) {
+ datum.open = false;
+ }
+ //datum.cls = "leafCls"
+ rebuildDatas.push(datum);
+ }
+ }
+ if (count == 0) {
+ rebuildDatas.pop();
+ }
+ }
+ dictionaryTree.refresh({data: rebuildDatas});
+ $(".searchCont").hide();
+ $("#dictionaryTree").show();
+}
+
+function searcherDict(val) {
+ var isShowParent = config.mappingRule.indexOf("parent") > -1, isShowLeaf = config.mappingRule.indexOf("leaf") > -1, datas = dictionaryTree.setting.dataModel.data;
+ searchArray = new Array();
+ for (var i = 0, size = datas.length; i < size; i++) {
+ var data = datas[i];
+ if (data.name.indexOf(val) > -1) {
+ searchArray.push(data);
+ if (data.isLeaf && !isShowLeaf) {
+ data.hidden = true;
+ continue;
+ }
+ if (!data.isLeaf && !isShowParent) {
+ data.hidden = true;
+ continue;
+ }
+ // 查找全路径
+ var array = new Array();
+ getAllPath(data.pid, array, datas);
+ var path = "";
+ for (var a = array.length - 1; a > -1; a--) {
+ path += array[a] + "/";
+ }
+ data.path = path;
+ }
+ }
+ $("#dictionaryTree").hide();
+ $("#back").show();
+ getHtml();
+ $.simpleAlert("close");
+}
+
+var selectArray = [];
+
+function addItem(json) {
+ var id = getId(json);
+ if (hasSame(selectArray, json)) {
+ return false;
+ }
+ var name = json["name"];
+ selectArray.push(json);
+ html = "";
+ html += "" + name + "";
+ html += "";
+ html += "";
+ $(".selectMult").append(html);
+}
+
+function removeItem(obj) {
+ var id = $(obj).parent().attr("id");
+ $("input[boxid=" + id + "]").check("option", "checked", false);
+ $(obj).parent().remove();
+ for (var i = 0, size = selectArray.length; i < size; i++) {
+ var data = selectArray[i];
+ if (getId(data) == id) {
+ selectArray.splice(i, 1);
+ return true;
+ }
+ }
+}
+
+function getId(json) {
+ if (json) {
+ return json.id ? json.id : json.dId;
+ }
+}
+
+function deleteItemByIndex(json) {
+ if (json) {
+ var id = getId(json);
+ $(".selectMult").find(".awsui-supertext-items").each(function () {
+ if (id == $(this).attr('id')) {
+ $(".selectMult").find("#" + id).remove();
+ }
+ });
+ for (var i = 0, size = selectArray.length; i < size; i++) {
+ var data = selectArray[i];
+ if (getId(data) == id) {
+ selectArray.splice(i, 1);
+ return true;
+ }
+ }
+ }
+}
+
+function hasSame(arrays, json) {
+ for (var i = 0, size = arrays.length; i < size; i++) {
+ var data = arrays[i];
+ if (getId(data) == getId(json)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function hasChildNode(id, datas) {
+ for (var i = 0, size = datas.length; i < size; i++) {
+ var data = datas[i];
+ if (id == data.pid) {
+ return true;
+ }
+ }
+ return false;
+}
+
+function getAllPath(pid, array, datas) {
+ if (pid == null || pid == "") {
+ return;
+ }
+ for (var i = 0, size = datas.length; i < size; i++) {
+ var data = datas[i];
+ if (pid == data.id) {
+ array.push(data.name);
+ getAllPath(data.pid, array, datas);
+ break;
+ }
+ }
+}
+
+// 搜索框事件
+function selectThisVal2(obj, i) {
+ var pid = $(obj).find("td").eq(1).attr("id");
+ getValue2(i, pid);
+ if (config.isGrid === false) {
+ parent.$("#popbox_tree_" + boItemName).popbox("close");
+ hideWeboffice();
+ }
+}
+
+// 搜索框判断
+function getValue2(index, pid) {
+ var isGrid = config.isGrid;
+ var selectNodeArray = getDataArray(index);
+ var valueData = {};
+ var separator = config.separator;
+ var displayValueData = {};
+
+ function buildValueData(x, value) {
+ if (valueData[x]) {
+ valueData[x] += separator + value;
+ } else {
+ valueData[x] = value;
+ }
+ }
+
+ function buildDisplayValueData(x, value) {
+ if (displayValueData[x]) {
+ displayValueData[x] += separator + value;
+ } else {
+ displayValueData[x] = value;
+ }
+ }
+
+ var fillBackFieldsConfig = config.fillBackFields.split("|");
+ if (selectNodeArray.length == 0) {
+ for (var s = 0; s < fillBackFieldsConfig.length; s++) {
+ buildValueData(fillBackFieldsConfig[s], "");
+ }
+ // parent.$.simpleAlert("请选择数据", "info", 1000, {
+ // model : true
+ // });
+ }
+ var json = {};
+ var hasTrueValue = false;
+ // 有正确回填的值
+ for (var m = 0; m < selectNodeArray.length; m++) {
+ var selectNode = selectNodeArray[m];
+ if (selectNode == undefined) {
+ return "";
+ }
+ var isLeaf = selectNode.isLeaf;
+ var fillBackValue = selectNode.fillBackFields;
+ var fillBackDisplayValue = selectNode.displayFieldValue;
+ for (var x in fillBackValue) {
+ var temp = false; // 当前判断结果
+ var value = fillBackValue[x].indexOf("^") > -1 ? fillBackValue[x].split("^")[1] : fillBackValue[x]; // 要回填的值
+ var sourveField = fillBackValue[x].split("^")[0]; // 要回填的源字段名
+ var tempValue = fillBackDisplayValue;
+ if (fillBackDisplayValue == null || fillBackDisplayValue == "") {
+ tempValue = value;
+ }
+ if (config.mappingRule == "") {
+ buildValueData(x, value);
+ buildDisplayValueData(x + "VAL", tempValue);
+ } else {
+ var mapping = config.mappingRule;
+ var rules = mapping.split(";");
+ var msg = "";
+ if (mapping.indexOf("parent") > -1) {
+ if (isLeaf) {
+ msg = "叶子节点";
+ } else {
+ //允许非叶子节点
+ temp = true;
+ }
+ }
+ if (temp == false) {
+ if (isLeaf) {
+ temp = true;
+ } else {
+ msg = "非叶子节点";
+ }
+ }
+ if (temp == false) {
+ parent.$.simpleAlert(msg + "不允许被回填", "info", 1000, {
+ model: true
+ });
+ }
+ if (temp == true) {
+ buildValueData(x, value);
+ buildDisplayValueData(x + "VAL", tempValue);
+ hasTrueValue = true;
+ }
+ }
+ }
+ }
+ if (!hasTrueValue && config.multiselect) {
+ parent.parent.$.simpleAlert("未找到可回填的节点", "info", 1000, {
+ model: true
+ });
+ }
+ if (hasTrueValue) {
+ $.each(valueData, function (key, value) {
+ if (isGrid) {
+ json[key] = value;
+ json[key + "_DISPLAYVALUE"] = displayValueData[key + "VAL"];
+ } else {
+ parent.$("#" + key).val(value);
+ parent.$("#" + key + "VAL").val(displayValueData[key + "VAL"]);
+ }
+ });
+ if (!isGrid) {
+ parent.UIInit.treeDictionaryHelper.refreshNode(boItemName);
+ }
+ if (isGrid) {
+ if (config.multiselect) {
+ return awsui.encode(json);
+ } else {
+ var boDefName = config.boDefName;
+ var boItemDefName = config.boItemDefName;
+ eval("parent." + boDefName + boItemDefName + "(json, config)");// 调用在grid的editor那注册的函数进行赋值
+ }
+ } else {
+ var beforVal = config.beforVal;
+ if (parent.triggerChangeByBoItemName) {
+ parent.triggerChangeByBoItemName(boItemName, beforVal);
+ }
+ }
+ if (window.onTreeDictionaryChangeEvent && typeof window.onTreeDictionaryChangeEvent == "function") {
+ window.onTreeDictionaryChangeEvent(config);
+ }
+ }
+}
+
+function getHtml() {
+ var s = searchArray.length;
+ if (s == 0) {
+ $("#searcontent").html("
" + 无数据 + "
");
+ $("#selectTd").hide();
+ $(".searchCont").show();
+ return;
+ }
+ if (config.multiselect) {
+ $("#selectTd").show();
+ }
+ var html = "";
+ var sortIndex = 1;
+ for (var i = 0, s = searchArray.length; i < s; i++) {
+ var o = searchArray[i], index = i + 1, click = "";
+ if (o.hidden) {
+ continue;
+ }
+ if (!config.multiselect) {
+ click = "onclick=\"selectThisVal2(this," + index + ")\"";
+ }
+ html += "