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

新增用户组件,日期组件修改

上级 7287223f
......@@ -58,10 +58,10 @@ layui.config({
}
});
var value;
if (dataType == 4) {
if (json.bean.dataType == 4) {
value = json.bean.businessApi;
} else {
value = dataType == 1 ? json.bean.defaultData : json.bean.objectId;
value = json.bean.dataType == 1 ? json.bean.defaultData : json.bean.objectId;
}
loadLinkData(json.bean.componentId, json.bean.dataType, value);
},
......@@ -180,17 +180,17 @@ layui.config({
initDictData();
$("#objectId").val(value);
} else if (dataType == 4) {
// 自定义
// 自定义接口
$("#dataTypeObjectBox").html(commonHtml['businessApi']);
$("#serviceStr").html(getDataUseHandlebars(selOption, {rows: serviceMap}));
loadParamsTable('apiParams');
if (!isNull(value)) {
$("#serviceStr").val(value.serviceStr);
$("#api").val(value.api);
skyeyeClassEnumUtil.showEnumDataListByClassName("httpMethodEnum", 'select', "method", businessApi.method, form);
skyeyeClassEnumUtil.showEnumDataListByClassName("httpMethodEnum", 'select', "method", value.method, form);
initTableChooseUtil.deleteAllRow('apiParams');
$.each(operateOpenPage.params, function(key, value) {
$.each(value.params, function(key, value) {
var params = {
"key": key,
"value": value
......@@ -212,7 +212,7 @@ layui.config({
id: id,
cols: [
{id: 'key', title: '入参Key', formType: 'input', width: '150', verify: 'required'},
{id: 'value', title: '', formType: 'input', width: '150', verify: 'required'}
{id: 'value', title: '(目前仅支持objectId和objectKey的传值)', formType: 'input', width: '150', verify: 'required'}
],
deleteRowCallback: function (trcusid) {
},
......
......@@ -77,7 +77,7 @@ layui.config({
// 新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023030400002&objectId=' + objectId + '&objectKey=' + objectKey, null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "contactsAdd",
......@@ -90,7 +90,7 @@ layui.config({
// 编辑
function edit(data) {
_openNewWindows({
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023030400003&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "contactsEdit",
......
......@@ -4,12 +4,13 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'eleTree'].concat(dsFormUtil.mastHaveImport), function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'eleTree', 'textool'].concat(dsFormUtil.mastHaveImport), function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
element = layui.element,
colorpicker = layui.colorpicker,
textool = layui.textool,
form = layui.form;
// 加载图标信息
......@@ -26,6 +27,8 @@ layui.config({
// 组件获取的值的合入接口入参的方式
skyeyeClassEnumUtil.showEnumDataListByClassName("componentValueMergType", 'radio', "valueMergType", '', form);
textool.init({eleId: 'remark', maxlength: 200});
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(2, function(json) {
$(".layui-colla-title").html(json.bean.title);
......@@ -85,6 +88,7 @@ layui.config({
applyRange: $("#applyRange input:radio:checked").val(),
applyObject: isNull($("#applyObject").attr("chooseId")) ? JSON.stringify([]) : $("#applyObject").attr("chooseId"),
valueMergType: dataShowType.getData('valueMergType'),
remark: $("#remark").val(),
linkedData: '2'
};
if ($("#linkedData").val() == 'true') {
......
......@@ -4,12 +4,13 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui'].concat(dsFormUtil.mastHaveImport), function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'textool'].concat(dsFormUtil.mastHaveImport), function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
element = layui.element,
colorpicker = layui.colorpicker,
textool = layui.textool;
form = layui.form;
showGrid({
......@@ -19,7 +20,7 @@ layui.config({
pagination: false,
method: 'GET',
template: $("#beanTemplate").html(),
ajaxSendLoadBefore: function(hdb) {
ajaxSendLoadBefore: function(hdb, json) {
hdb.registerHelper("compare2", function (v1, options) {
if (v1 == '1') {
return 'checked';
......@@ -38,6 +39,7 @@ layui.config({
return 'false';
}
});
json.bean.remark = stringManipulation.textAreaShow(json.bean.remark);
},
ajaxSendAfter: function(json) {
// 加载图标信息
......@@ -54,6 +56,8 @@ layui.config({
// 组件获取的值的合入接口入参的方式
skyeyeClassEnumUtil.showEnumDataListByClassName("componentValueMergType", 'radio', "valueMergType", json.bean.valueMergType, form);
textool.init({eleId: 'remark', maxlength: 200});
// 根据类型获取部分功能的使用说明
systemCommonUtil.queryExplainMationByType(2, function (json) {
$(".layui-colla-title").html(json.bean.title);
......@@ -101,6 +105,7 @@ layui.config({
applyRange: $("#applyRange input:radio:checked").val(),
applyObject: isNull($("#applyObject").attr("chooseId")) ? JSON.stringify([]) : $("#applyObject").attr("chooseId"),
valueMergType: dataShowType.getData('valueMergType'),
remark: $("#remark").val(),
id: parent.rowId
};
if ($("#linkedData").val() == 'true') {
......
......@@ -11,6 +11,9 @@ var sortDataIn;
// 业务对象的属性信息
var attrList = [];
// 这两个参数为开启团队权限的对象拥有,这里没有实际用处,用于加载组件时临时有用。
var objectId = '', objectKey = '';
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -226,13 +229,13 @@ layui.config({
}
var tip_index;
$("body").on("mouseenter", ".attr-mation", function (e) {
$("body").on("mouseenter", ".attr-mation, .component", function (e) {
var title = $(this).attr('title');
if (isNull(title)) {
return false;
}
tip_index = layer.tips(title, this, {time: 0, tips: 3});
}).on('mouseleave', ".attr-mation", function() {
}).on('mouseleave', ".attr-mation, .component", function() {
layer.close(tip_index);
});
......
......@@ -99,6 +99,41 @@ layui.config({
</div>
</div>`,
'dateTimeTypeBox': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">日期类型<i class="red">*</i></label>
<div class="layui-input-block" id="dateTimeType">
</div>
</div>`,
'userSelBox': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">是否包含自己<i class="red">*</i></label>
<div class="layui-input-block">
<select lay-filter="chooseOrNotMy" lay-search="" id="chooseOrNotMy" name="chooseOrNotMy" win-verify="required">
<option value="">请选择</option>
<option value="1">包含</option>
<option value="2">不包含</option>
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">绑定邮箱<i class="red">*</i></label>
<div class="layui-input-block">
<select lay-filter="chooseOrNotEmail" lay-search="" id="chooseOrNotEmail" name="chooseOrNotEmail" win-verify="required">
<option value="">请选择</option>
<option value="1">必须</option>
<option value="2">非必须</option>
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">选择类型<i class="red">*</i></label>
<div class="layui-input-block">
<select lay-filter="checkType" lay-search="" id="checkType" name="checkType" win-verify="required">
<option value="">请选择</option>
<option value="1">多选</option>
<option value="2">单选</option>
</select>
</div>
</div>`,
};
// 详情类布局才展示的组件属性
var detailsPageAttr = ['attrKeyBox', 'titleBox', 'widthBox'];
......@@ -123,6 +158,10 @@ layui.config({
$("#defaultValue").val(data.defaultValue);
$("#uploadNum").val(data.uploadNum);
$("#chooseOrNotMy").val(data.chooseOrNotMy);
$("#chooseOrNotEmail").val(data.chooseOrNotEmail);
$("#checkType").val(data.checkType);
// 属性信息
var attrs = [];
$.each(parent.attrList, function (i, item) {
......@@ -173,6 +212,9 @@ layui.config({
// 是否可以编辑
skyeyeClassEnumUtil.showEnumDataListByClassName("whetherEnum", 'radio', "isEdit", data.isEdit, form);
// 日期类型
skyeyeClassEnumUtil.showEnumDataListByClassName("dateTimeType", 'select', "dateTimeType", data.dateTimeType, form);
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
......@@ -203,6 +245,11 @@ layui.config({
newParams.attrKey = $("#attrKey").val();
newParams.teamObjectType = $("#teamObjectType").val();
newParams.isEdit = dataShowType.getData("isEdit");
newParams.dateTimeType = dataShowType.getData("dateTimeType");
newParams.chooseOrNotMy = $("#chooseOrNotMy").val();
newParams.chooseOrNotEmail = $("#chooseOrNotEmail").val();
newParams.checkType = $("#checkType").val();
if (!isNull($("#attrKey").val())) {
newParams.attrDefinition = getInPoingArr(parent.attrList, 'attrKey', $("#attrKey").val());
......
......@@ -119,6 +119,13 @@
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">相关描述</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入相关描述" class="layui-textarea" style="height: 100px;" maxlength="200"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
......@@ -125,6 +125,13 @@
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">相关描述</label>
<div class="layui-input-block">
<textarea id="remark" name="remark" placeholder="请输入相关描述" class="layui-textarea" style="height: 100px;" maxlength="200">{{remark}}</textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
......@@ -41,7 +41,7 @@
<span class="hr-title">{{@key}}</span><hr>
</div>
{{#each @this}}
<div class="btntext" componentId="{{id}}">
<div class="btntext component" componentId="{{id}}" title="{{remark}}">
<div class="icon">
{{{logo}}}
</div>
......
......@@ -134,8 +134,8 @@ layui.config({
// 新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023030400002&objectId=' + objectId + '&objectKey=' + objectKey, null),
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023030500001&objectId=' + objectId + '&objectKey=' + objectKey, null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "contactsAdd",
area: ['90vw', '90vh'],
......@@ -147,7 +147,7 @@ layui.config({
// 编辑
function edit(data) {
_openNewWindows({
parent._openNewWindows({
url: systemCommonUtil.getUrl('FP2023030400003&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "contactsEdit",
......
......@@ -44,7 +44,10 @@ layui.config({
placeholder: '请选择关联人员',
editorTag: false,
beforeTagDelete: function(field, editor, tags, val) {
userList = [].concat(arrayUtil.removeArrayPointName(userList, val));
var listVal = $("#").attr('list');
var list = isNull(listVal) ? [] : JSON.parse(listVal);
list = [].concat(arrayUtil.removeArrayPointName(list, val));
$("#").attr('list', JSON.stringify(list));
}
});
// 关联人员选择选择
......
......@@ -829,6 +829,9 @@ function getUserStaffHtmlMationByStaffId(staffId){
*/
var stringManipulation = {
textAreaShow: function(str){
if (isNull(str)) {
return '';
}
// IE7-8、IE9、FF、chrome。解决textarea中输入的文字,输出到div中文字不换自动换行的问题
return str.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
}
......
......@@ -297,11 +297,11 @@ var systemCommonUtil = {
tagEditorGetAllData: function (id, list) {
var tags = $('#' + id).tagEditor('getTags')[0].tags;
if (list.length == 0 || isNull(tags)) {
return "";
return [];
} else {
var ids = "";
var ids = [];
$.each(list, function (i, item) {
ids += item.id + ',';
ids.push(item.id);
});
return ids;
}
......
......@@ -219,6 +219,10 @@ var dsFormUtil = {
content.attrDefinition = {};
}
if (!isNull(content.require)) {
content.require = content.require.join('|');
}
var jsonStr = {bean: content};
var html = getDataUseHandlebars('{{#bean}}' + component.htmlContent + '{{/bean}}', jsonStr);
var html_js = getDataUseHandlebars('{{#bean}}' + component.jsContent + '{{/bean}}', jsonStr);
......@@ -324,6 +328,7 @@ var dsFormUtil = {
return content.title;
},
// 获取属性关联的数据值来源信息
getContentLinkedData: function (content) {
var json = {};
if (isNull(content.attrDefinition) || isNull(content.attrDefinition.attrDefinitionCustom)) {
......@@ -331,7 +336,7 @@ var dsFormUtil = {
}
var customAttr = content.attrDefinition.attrDefinitionCustom;
var dataType = customAttr.dataType;
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData)) {
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData) && isNull(customAttr.businessApi) && $.isEmptyObject(customAttr.businessApi)) {
return content;
}
if (dataType == 1) {
......@@ -349,6 +354,20 @@ var dsFormUtil = {
sysDictDataUtil.queryDictDataListByDictTypeCode(customAttr.objectId, function (data) {
json = data.rows;
});
} else if (dataType == 4) {
// 自定义接口
var businessApi = customAttr.businessApi;
var params = {};
$.each(businessApi.params, function (key, value) {
var realValue = "";
eval('realValue = ' + value);
params[key] = realValue;
});
var url = "";
eval('url = ' + businessApi.serviceStr + ' + "' + businessApi.api + '"');
AjaxPostUtil.request({url: url, params: params, type: 'json', method: businessApi.method, callback: function (data) {
json = data.rows;
}, async: false});
}
if (!isNull(content.dsFormComponent.htmlDataFrom)) {
content.context = getDataUseHandlebars(content.dsFormComponent.htmlDataFrom, json);
......@@ -356,6 +375,7 @@ var dsFormUtil = {
return content;
},
// 获取显示值
getContentLinkedDataValue: function (content, value) {
if (isNull(value)) {
return null;
......@@ -371,7 +391,7 @@ var dsFormUtil = {
}
}
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData)) {
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData) && isNull(customAttr.businessApi) && $.isEmptyObject(customAttr.businessApi)) {
return value;
}
......@@ -389,6 +409,22 @@ var dsFormUtil = {
} else if (dataType == 3) {
// 数据字典
return sysDictDataUtil.getDictDataNameByCodeAndKey(customAttr.objectId, value);
} else if (dataType == 4) {
// 自定义接口
var businessApi = customAttr.businessApi;
var params = {};
$.each(businessApi.params, function (key, value) {
var realValue = "";
eval('realValue = ' + value);
params[key] = realValue;
});
var url = "";
var obj = [];
eval('url = ' + businessApi.serviceStr + ' + "' + businessApi.api + '"');
AjaxPostUtil.request({url: url, params: params, type: 'json', method: businessApi.method, callback: function (json) {
obj = json.beans;
}, async: false});
return getInPoingArr(obj, "id", value, "name");
}
return value;
},
......@@ -639,7 +675,7 @@ var dsFormTableUtil = {
}
var customAttr = item.attrDefinition.attrDefinitionCustom;
var dataType = customAttr.dataType;
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData)) {
if (isNull(customAttr.objectId) && isNull(customAttr.defaultData) && isNull(customAttr.businessApi) && $.isEmptyObject(customAttr.businessApi)) {
return null;
}
if (dataType == 1) {
......@@ -658,6 +694,25 @@ var dsFormTableUtil = {
} else if (dataType == 3) {
// 数据字典
return `function (d) {return sysDictDataUtil.getDictDataNameByCodeAndKey('${customAttr.objectId}', d.${item.attrKey});}`;
} else if (dataType == 4) {
// 自定义接口
var businessApi = customAttr.businessApi;
var params = {};
$.each(businessApi.params, function (key, value) {
var realValue = "";
eval('realValue = ' + value);
params[key] = realValue;
});
var url = "";
var obj = [];
eval('url = ' + businessApi.serviceStr + ' + "' + businessApi.api + '"');
AjaxPostUtil.request({url: url, params: params, type: 'json', method: businessApi.method, callback: function (json) {
obj = json.beans;
}, async: false});
return `function (d) {
var json = ${obj};
return getInPoingArr(json, "id", d.${item.attrKey}, "name");
}`;
}
}
return null;
......
......@@ -5,6 +5,7 @@
"verificationParams": {"name": "字段校验枚举", "className": "skyeye-pro#com.skyeye.common.enumeration.VerificationParamsEnum"},
"isUsed": {"name": "是否使用的枚举", "className": "skyeye-pro#com.skyeye.common.enumeration.IsUsedEnum"},
"whetherEnum": {"name": "是否的枚举", "className": "skyeye-pro#com.skyeye.common.enumeration.WhetherEnum"},
"dateTimeType": {"name": "日期类型", "className": "skyeye-pro#com.skyeye.dsform.classenum.DateTimeType"},
"bossInterviewArrangementState": {"name": "面试安排状态枚举类", "className": "skyeye-flowable#com.skyeye.service.enumclass.BossInterviewArrangementState"},
"bossInterviewArrangementState1": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册