提交 c1f7c5aa 编写于 作者: doc_wei's avatar doc_wei

新增业务编码配置功能

上级 0c9d9047
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form;
// 获取所有编码规则
var codeRuleSelectHtml = '';
AjaxPostUtil.request({url: reqBasePath + "getAllCodeRuleList", params: {}, type: 'json', method: "GET", callback: function(json) {
codeRuleSelectHtml = getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), json);
}, async: false});
// 获取需要配置编码规则的业务功能对象
showGrid({
id: "showForm",
url: reqBasePath + "queryClassCodeRuleList",
params: {},
pagination: false,
method: "GET",
template: $("#baseTemplate").html(),
ajaxSendLoadBefore: function (hdb, json) {
$.each(json.bean, function (key, value) {
$.each(value, function (i, item) {
item.selectHtml = codeRuleSelectHtml;
})
})
},
ajaxSendAfter: function (json) {
$.each(json.bean, function (key, value) {
$.each(value, function (i, item) {
$("#" + item.id).val(item.codeRuleId);
})
})
form.render();
form.on('select(codeRole)', function(data) {
var cudeRuleId = data.value;
var id = data.elem.id;
AjaxPostUtil.request({url: reqBasePath + "editClassCodeRuleConfig", params: {id: id, cudeRuleId: cudeRuleId}, type: 'json', method: "POST", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
}});
});
}
});
exports('businessDataCodeRuleConfig', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin: 0 auto; padding: 20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script type="text/x-handlebars-template" id="baseTemplate">
{{#each bean}}
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header"><b>{{@key}}</b></div>
<div class="layui-card-body" style="display: inline-block;">
{{#each @this}}
<blockquote class="layui-elem-quote layui-quote-nm layui-col-md2">
{{serviceName}}
<select lay-filter="codeRole" lay-search="" id="{{id}}" win-verify="required">
{{{selectHtml}}}
</select>
</blockquote>
{{/each}}
</div>
</div>
</div>
{{/each}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/codeRule/'}).use('businessDataCodeRuleConfig');
</script>
</body>
</html>
\ No newline at end of file
......@@ -478,13 +478,17 @@ layui.define(["jquery", "dragula", 'winui', 'form', 'element'], function(exports
};
} else {
var content = variableMap[value].content;
if (variableMap[value].type == 'map' && !isNull(variableMap[value].content)) {
var contentMap = {};
content = content.split(/\n/);
$.each(content, function (i, item) {
contentMap[item.split("|")[0]] = item.split("|")[1];
});
content = contentMap;
if (variableMap[value].type == 'map') {
if (!isNull(variableMap[value].content)) {
var contentMap = {};
content = content.split(/\n/);
$.each(content, function (i, item) {
contentMap[item.split("|")[0]] = item.split("|")[1];
});
content = contentMap;
} else {
content = {};
}
}
params = {
type: variableMap[value].type,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册