提交 4b953a0f 编写于 作者: Skyeye云's avatar Skyeye云

表格布局新增特有属性

上级 5a3c8602
......@@ -29,6 +29,7 @@ layui.config({
var alignmentData = skyeyeClassEnumUtil.getEnumDataListByClassName("alignment");
var fixedTypeData = skyeyeClassEnumUtil.getEnumDataListByClassName("fixedType");
var whetherEnumData = skyeyeClassEnumUtil.getEnumDataListByClassName("whetherEnum");
AjaxPostUtil.request({url: reqBasePath + "dsformpage006", params: {id: pageId}, type: 'json', method: "GET", callback: function (data) {
tableDataList = isNull(data.bean.tableColumnList) ? [] : data.bean.tableColumnList;
......@@ -48,7 +49,7 @@ layui.config({
cols: [[
{ type: 'checkbox', align: 'center' },
{ field: 'attrKey', title: '属性<i class="red">*</i>', align: 'left', width: 150, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
var _html = `<select lay-filter="tableSelect" lay-search="" id="attrKey${d.id}" cus-id="${d.id}" win-verify="required"><option value="">请选择</option>`;
$.each(attrList, function (i, item) {
if (item.attrKey == d.attrKey) {
_html += `<option value="${item.attrKey}" selected="selected">${item.name}</option>`;
......@@ -60,7 +61,7 @@ layui.config({
return _html;
}},
{ field: 'align', title: '对齐方式<i class="red">*</i>', align: 'left', width: 120, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="align${d.id}" cus-id="${d.id}" win-verify="required"><option value="">全部</option>`;
var _html = `<select lay-filter="tableSelect" lay-search="" id="align${d.id}" cus-id="${d.id}" win-verify="required"><option value="">请选择</option>`;
$.each(alignmentData.rows, function (i, item) {
if (item.id == d.align) {
_html += `<option value="${item.id}" selected="selected">${item.name}</option>`;
......@@ -72,7 +73,7 @@ layui.config({
return _html;
}},
{ field: 'fixed', title: '固定位置', align: 'left', width: 120, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="fixed${d.id}" cus-id="${d.id}"><option value="">全部</option>`;
var _html = `<select lay-filter="tableSelect" lay-search="" id="fixed${d.id}" cus-id="${d.id}"><option value="">请选择</option>`;
$.each(fixedTypeData.rows, function (i, item) {
if (item.id == d.fixed) {
_html += `<option value="${item.id}" selected="selected">${item.name}</option>`;
......@@ -83,6 +84,18 @@ layui.config({
_html += `</select>`;
return _html;
}},
{ field: 'hide', title: '默认隐藏', align: 'left', width: 120, templet: function (d) {
var _html = `<select lay-filter="tableSelect" lay-search="" id="hide${d.id}" cus-id="${d.id}"><option value="">请选择</option>`;
$.each(whetherEnumData.rows, function (i, item) {
if (item.id == d.hide) {
_html += `<option value="${item.id}" selected="selected">${item.name}</option>`;
} else {
_html += `<option value="${item.id}">${item.name}</option>`;
}
});
_html += `</select>`;
return _html;
}},
{ field: 'width', title: '宽度<i class="red">*</i>', align: 'left', width: 120, templet: function (d) {
return `<input type="text" id="width${d.id}" placeholder="请填写宽度" cus-id="${d.id}" class="layui-input tableInput" win-verify="required|number" ` +
`value="` + (isNull(d.width) ? "" : d.width) + `"/>`;
......
......@@ -10,6 +10,20 @@ layui.config({
var $ = layui.$,
form = layui.form;
var selOption = getFileContent('tpl/template/select-option.tpl');
var pageHtml = {
'simpleTable': `<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">是否分页<i class="red">*</i></label>
<div class="layui-input-block" id="isPage">
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">搜索框提示语<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="searchTips" name="searchTips" win-verify="required" placeholder="请输入提示语" class="layui-input"/>
</div>
</div>`
};
$("#serviceStr").html(getDataUseHandlebars(selOption, {rows: serviceMap}));
......@@ -25,6 +39,8 @@ layui.config({
skyeyeClassEnumUtil.showEnumDataListByClassName("httpMethodEnum", 'select', "method", businessApi.method, form);
loadOperate(json.bean.operateIdList);
// 加载其他的dom
initOtherDom(json.bean.type, json.bean);
}});
} else {
skyeyeClassEnumUtil.showEnumDataListByClassName("dsFormPageType", 'select', "type", '', form);
......@@ -39,6 +55,20 @@ layui.config({
}});
}
form.on('select(type)', function(data) {
initOtherDom(data.value, {});
});
function initOtherDom(type, data) {
if (type == 'simpleTable') {
$('#otherDom').html(pageHtml[type]);
skyeyeClassEnumUtil.showEnumDataListByClassName("whetherEnum", 'radio', "isPage", data.isPage, form);
$("#searchTips").val(data.searchTips);
} else {
$('#otherDom').html('');
}
}
matchingLanguage();
form.render();
form.on('submit(formWriteBean)', function (data) {
......@@ -51,6 +81,12 @@ layui.config({
className: parent.objectId,
operateIdList: isNull($('#operateIdList').attr('value')) ? [] : $('#operateIdList').attr('value')
};
if (params.type == 'simpleTable') {
params['isPage'] = $("#isPage input:radio:checked").val();
params['searchTips'] = $("#searchTips").val();
}
var businessApi = {
serviceStr: $("#serviceStr").val(),
api: $("#api").val(),
......
......@@ -24,6 +24,9 @@
<select lay-filter="type" lay-search="" win-verify="required" id="type" name="type">
</select>
</div>
</div>
<div id="otherDom">
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">关联操作</label>
......
......@@ -12,7 +12,7 @@ layui.config({
form = layui.form,
fsTree = layui.fsTree,
fsCommon = layui.fsCommon;
var id = GetUrlParam("id");
var checkeRows = '';
matchingLanguage();
......@@ -45,7 +45,7 @@ layui.config({
var params = {
menuIds: menuIds,
pointIds: pointIds,
id: parent.rowId
id: id
};
AjaxPostUtil.request({url: reqBasePath + "sys039", params: params, type: 'json', callback: function (json) {
......@@ -60,7 +60,7 @@ layui.config({
/********* tree 处理 start *************/
var tree;
AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: id}, type: 'json', method: "GET", callback: function (json) {
$("#name").text(json.bean.name);
$("#remark").text(json.bean.remark);
checkeRows = json.bean.appMenuIds;
......
......@@ -11,7 +11,7 @@ layui.config({
form = layui.form,
fsTree = layui.fsTree,
fsCommon = layui.fsCommon;
var id = GetUrlParam("id");
var checkeRows = '';
matchingLanguage();
......@@ -28,7 +28,7 @@ layui.config({
name: $("#name").html(),
remark: $("#remark").html(),
menuIds: JSON.stringify(menuIds),
rowId: parent.rowId
rowId: id
};
AjaxPostUtil.request({url: reqBasePath + "editSysRolePCAuth", params: params, type: 'json', method: "PUT", callback: function (json) {
......@@ -42,7 +42,7 @@ layui.config({
/********* tree 处理 start *************/
var tree;
AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "querySysRoleById", params: {id: id}, type: 'json', method: "GET", callback: function (json) {
$("#name").text(json.bean.name);
$("#remark").text(json.bean.remark);
checkeRows = json.bean.menuIds;
......
......@@ -3436,11 +3436,12 @@ hr,
.layui-table-tool {
position: relative;
width: 100%;
height: 50px;
height: 35px;
line-height: 30px;
padding: 10px 15px;
padding: 0px 15px;
border-width: 0;
border-bottom-width: 1px;
text-align: right;
}
.layui-table-page {
......
......@@ -1027,7 +1027,7 @@ var dataShowType = {
} else if (showType == 'radio') {
// 单选框
$("#" + showBoxId).html(getDataUseHandlebars('{{#each rows}}<input type="radio" name="' + showBoxId + 'Name" value="{{id}}" title="{{name}}" />{{/each}}', json));
if (!isNull(defaultId)) {
if (!isNull(defaultId) || defaultId == 0) {
$("#" + showBoxId + " input:radio[name=" + showBoxId + "Name][value=" + defaultId + "]").attr("checked", true);
} else {
$.each(json.rows, function (i, item) {
......
......@@ -554,8 +554,9 @@ var dsFormTableUtil = {
method: api.method,
url: url,
where: dsFormTableUtil.getTableParams(),
toolbar: true,
even: true,
page: true,
page: pageMation.isPage == 1 ? true : false,
overflow: {type: 'tips', header: true, total: true},
limits: getLimits(),
limit: getLimit(),
......@@ -565,7 +566,7 @@ var dsFormTableUtil = {
}, tableColumnList),
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入", function () {
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, pageMation.searchTips, function () {
table.reloadData(id, {page: {curr: 1}, where: dsFormTableUtil.getTableParams()});
});
}
......@@ -590,15 +591,18 @@ var dsFormTableUtil = {
}
$.each(operateList, function (i, item) {
dsFormTableUtil.operateMap[item.id] = item;
if (item.position == 'toolBar') {
// 工具栏
$(`#${item.position}`).append(`<button id="${item.id}" class="winui-toolbtn search-table-btn-right item-click"><i class="fa fa-plus" aria-hidden="true"></i>${item.name}</button>`);
} else if (item.position == 'actionBar') {
// 操作栏
$(`#${item.position}`).append(`<a class="layui-btn layui-btn-xs ${item.color}" lay-event="${item.id}">${item.name}</a>`);
} else if (item.position == 'rightMenuBar') {
// 右键菜单栏
if (isNull(item.authPointNum) || (!isNull(item.authPointNum) && auth(item.authPointNum))) {
// 权限校验
if (item.position == 'toolBar') {
// 工具栏
$(`#${item.position}`).append(`<button id="${item.id}" class="winui-toolbtn search-table-btn-right item-click"><i class="fa fa-plus" aria-hidden="true"></i>${item.name}</button>`);
} else if (item.position == 'actionBar') {
// 操作栏
$(`#${item.position}`).append(`<a class="layui-btn layui-btn-xs ${item.color}" lay-event="${item.id}">${item.name}</a>`);
} else if (item.position == 'rightMenuBar') {
// 右键菜单栏
}
}
});
},
......@@ -608,7 +612,8 @@ var dsFormTableUtil = {
if (!isNull(column.serialNumColumn) && column.serialNumColumn) {
header.push({
title: systemLanguage["com.skyeye.serialNumber"][languageType],
type: 'numbers'
type: 'numbers',
fixed: 'left'
});
}
$.each(tableColumnList, function (i, item) {
......@@ -617,6 +622,8 @@ var dsFormTableUtil = {
title: item.label,
align: item.align,
width: item.width,
fixed: isNull(item.fixed) ? '' : item.fixed,
hide: (!isNull(item.hide) && item.hide == 1) ? true : false,
templet: null
};
if (!isNull(item.templet)) {
......
<option value="">全部</option>
<option value="">请选择</option>
{{#each rows}}
<option value="{{id}}">{{name}}</option>
{{/each}}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册