提交 d2f4091c 编写于 作者: L LAPTOP-UV1MNL38\18023

Merge branch 'company_server' of https://gitee.com/doc_wei01/skyeye into company_server

......@@ -52,6 +52,7 @@ layui.config({
{ field: 'name', title: '资产名称', width: 120, templet: function(d) {
return getNotUndefinedVal(d.assetMation?.name);
}},
{ field: 'assetNum', title: '资产编号', align: 'left', width: 150 },
{ field: 'specifications', title: '资产规格', width: 120, templet: function(d) {
return getNotUndefinedVal(d.assetMation?.specifications);
}},
......@@ -62,7 +63,7 @@ layui.config({
{ field: 'typeId', title: '资产类型', width: 120, templet: function(d) {
return sysDictDataUtil.getDictDataNameByCodeAndKey("ADM_ASSET_TYPE", d.typeId);
}},
{ field: 'assetNum', title: '资产编号', align: 'left', width: 150 },
// { field: 'specifications', title: '资产规格', align: 'left', width: 120 },
{ field: 'assetAdminMation', title: '管理员', width: 120, templet: function(d) {
return getNotUndefinedVal(d.assetAdminMation?.name);
......@@ -72,7 +73,7 @@ layui.config({
done: function(res) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入资产名称,资产编号", function () {
initTableSearchUtil.initAdvancedSearch(this, res.searchFilter, form, "请输入资产编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
if (myUseAssetReportCheckType) {
......
......@@ -23,6 +23,7 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'assetNum', title: '资产编号', align: 'left', width: 200 },
{ field: 'name', title: '资产名称', width: 120, templet: function(d) {
return getNotUndefinedVal(d.assetMation?.name);
}},
......@@ -32,7 +33,6 @@ layui.config({
{ field: 'typeId', title: '资产类型', width: 120, templet: function(d) {
return sysDictDataUtil.getDictDataNameByCodeAndKey("ADM_ASSET_TYPE", d.assetMation.typeId);
}},
{ field: 'assetNum', title: '资产编号', align: 'left', width: 150 },
{ field: 'assetAdminMation', title: '管理员', width: 120, templet: function(d) {
return getNotUndefinedVal(d.assetAdminMation?.name);
}},
......@@ -40,7 +40,7 @@ layui.config({
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入资产名称,资产编号", function () {
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入资产编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
......
......@@ -28,23 +28,29 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers' },
{ field: 'oddNumber', title: '单号', align: 'center', rowspan: '2', width: 200, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
}},
{ field: 'processInstanceId', title: '流程ID', width: 280, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + getNotUndefinedVal(d.processInstanceId) + '</a>';
{ field: 'oddNumber', title: '单号', rowspan: '2', align: 'left', width: 220, templet: function (d) {
var str = '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
if (!isNull(d.fromId)) {
str += '<span class="state-new">[转]</span>';
}
return str;
}},
{ colspan: '2', title: '来源单据信息', align: 'center' },
{ field: 'operTime', width: 150, title: '单据日期', rowspan: '2',align: 'center'},
{ field: 'name', title: '产品名称', align: 'left',rowspan: '2',width: 150, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: '---', width: 150, align: 'center', rowspan: '2',title: '规格'},
{ field: '---', width: 150, align: 'center', rowspan: '2',title: '交货日期'},
{ field: '---', width: 150, align: 'center', rowspan: '2',title: '数量'},
{ field: 'processInstanceId', title: '流程ID', rowspan: '2',width: 280, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + getNotUndefinedVal(d.processInstanceId) + '</a>';
}},
{ field: 'state', title: '状态', rowspan: '2', width: 90, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("erpOrderStateEnum", 'id', d.state, 'name');
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', rowspan: '2',width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', rowspan: '2',width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', rowspan: '2',width: 120 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', rowspan: '2',width: 150},
{ title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar' }
],[
{ field: 'fromTypeId', title: '来源类型', rowspan: '2',width: 150, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sealOutLetFromType", 'id', d.fromTypeId, 'name');
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("productionPlanFromType", 'id', d.fromTypeId, 'name');
}},
{ field: 'fromId', title: '单据编号', rowspan: '2',width: 200, templet: function (d) {
return getNotUndefinedVal(d.fromMation?.oddNumber);
......
......@@ -18,11 +18,10 @@ layui.config({
// 预生产计划 转 生产计划
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryProductionPlanTransById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
let data = json.bean;
console.log(5555,data)
// 因为要调生产计划的编辑布局,所以把预生产计划里的productionPlanChildList给到生产计划里的productionChildList
data.productionChildList = data.productionPlanChildList
// 生产计划的【编辑布局】
dsFormUtil.initEditPageForStatic('content', 'FP2023092200002', data, {
savePreParams: function (params) {
},
saveData: function (params) {
// 保存数据
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "insertProductionPlanToProduction", params: params, type: 'json', method: "POST", callback: function(json) {
......@@ -31,18 +30,18 @@ layui.config({
}});
},
// 移除来源单据
loadComponentCallback: function () {
$("div[controlType='productionFromType']").remove();
},
// 新增行的回调函数
// tableAddRowCallback: function (tableId) {
// $("#addRow" + tableId).remove();
// $("div[controlType='simpleTable']").find(".chooseProductBtn").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".unitPrice").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".amountOfMoney").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".taxRate").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".taxMoney").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".taxUnitPrice").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".taxLastMoney").prop('disabled', true);
// $("div[controlType='simpleTable']").find(".specifications").prop('disabled', true);
// }
tableAddRowCallback: function (tableId) {
$("#addRow" + tableId).remove();
$("div[controlType='simpleTable']").find(".chooseProductBtn").prop('disabled', true);
$("div[controlType='simpleTable']").find(".normsId").prop('disabled', true);
}
});
}});
});
\ No newline at end of file
......@@ -27,22 +27,29 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers' },
{ field: 'oddNumber', title: '单号', align: 'center', rowspan: '2', width: 200, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
}},
{ field: 'processInstanceId', title: '流程ID', width: 280, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + getNotUndefinedVal(d.processInstanceId) + '</a>';
{ field: 'oddNumber', title: '单号', rowspan: '2', align: 'left', width: 220, templet: function (d) {
var str = '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
if (!isNull(d.fromId)) {
str += '<span class="state-new">[转]</span>';
}
return str;
}},
{ colspan: '2', title: '来源单据信息', align: 'center' },
{ field: 'operTime', width: 150, title: '单据日期', rowspan: '2',align: 'center'},
{ field: 'name', title: '产品名称', align: 'left',rowspan: '2',width: 150, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: 'salesOrderNum', width: 100, title: '生产类型', rowspan: '2',align: 'center', templet: function (d) {return isNull(d.sealOrderMation) ? '' : d.sealOrderMation.oddNumber}},
{ field: 'name', title: 'bom方案', align: 'left',rowspan: '2',width: 150, templet: function (d) {return isNull(d.materialMation) ? '' : d.materialMation.name}},
{ field: '---', width: 150, align: 'center', rowspan: '2',title: '交货日期'},
{ field: 'processInstanceId', title: '流程ID', rowspan: '2',width: 280, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + getNotUndefinedVal(d.processInstanceId) + '</a>';
}},
{ field: 'state', title: '状态', rowspan: '2', width: 90, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("erpOrderStateEnum", 'id', d.state, 'name');
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', rowspan: '2',width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', rowspan: '2',width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', rowspan: '2',width: 120 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', rowspan: '2',width: 150},
{ title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar' }
],[
{ field: 'fromTypeId', title: '来源类型', rowspan: '2',width: 150, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sealOutLetFromType", 'id', d.fromTypeId, 'name');
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("productionFromType", 'id', d.fromTypeId, 'name');
}},
{ field: 'fromId', title: '单据编号', rowspan: '2',width: 200, templet: function (d) {
return getNotUndefinedVal(d.fromMation?.oddNumber);
......
......@@ -110,44 +110,44 @@ layui.config({
}});
}
// // 删除
// function del(data, obj) {
// layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
// layer.close(index);
// AjaxPostUtil.request({url: sysMainMation.erpBasePath + "deleteProductionById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
// winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
// loadTable();
// }});
// });
// }
// 删除
function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon005", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// // 提交审批
// function subApproval(data) {
// layer.confirm(systemLanguage["com.skyeye.approvalOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.approvalOperation"][languageType]}, function (index) {
// layer.close(index);
// activitiUtil.startProcess(data.serviceClassName, null, function (approvalId) {
// var params = {
// id: data.id,
// approvalId: approvalId
// };
// AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpproduction007", params: params, type: 'json', method: 'POST', callback: function (json) {
// winui.window.msg("提交成功", {icon: 1, time: 2000});
// loadTable();
// }});
// });
// });
// }
// 提交审批
function subApproval(data) {
layer.confirm(systemLanguage["com.skyeye.approvalOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.approvalOperation"][languageType]}, function (index) {
layer.close(index);
activitiUtil.startProcess(data.serviceClassName, null, function (approvalId) {
var params = {
id: data.id,
approvalId: approvalId
};
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon006", params: params, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
});
});
}
// // 撤销
// function revoke(data) {
// layer.confirm('确认撤销该申请吗?', { icon: 3, title: '撤销操作' }, function (index) {
// layer.close(index);
// AjaxPostUtil.request({url: sysMainMation.erpBasePath + "revokeProduction", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
// winui.window.msg("提交成功", {icon: 1, time: 2000});
// loadTable();
// }});
// });
// }
// 撤销
function revoke(data) {
layer.confirm('确认撤销该申请吗?', { icon: 3, title: '撤销操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpcommon003", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
form.render();
$("body").on("click", "#reloadTable", function() {
......
......@@ -17,19 +17,19 @@
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.editRow == 1) { }}
{{# if(auth('1720705286166')) { }}
{{# if(auth('1721036771903')) { }}
<a class="layui-btn layui-btn-xs" lay-event="subApproval">提交审批</a>
{{# } }}
{{# if(auth('1590913527206')) { }}
{{# if(auth('1720835673573')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1590926876459')) { }}
{{# if(auth('1721036781887')) { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } }}
{{# if(d.editRow == 2) { }}
{{# if(auth('1696246760629')) { }}
{{# if(auth('1721036798487')) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
......
......@@ -15,10 +15,9 @@ layui.config({
var $ = layui.$;
var id = GetUrlParam("id");
// 销售订单转销售出库
// 销售订单转销售退货
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "querySealsOrderTransById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
let data = json.bean;
console.log(5555,data)
// 销售退货的【编辑布局】
dsFormUtil.initEditPageForStatic('content', 'FP2023042700006', data, {
savePreParams: function (params) {
......
var rowId = "";
var parentNode = null;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'dropdown', 'fsCommon', 'fsTree', 'table', 'form'], function (exports) {
}).define(['window', 'tableTreeDj','jquery', 'winui', 'dropdown', 'fsCommon', 'fsTree', 'table', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
fsTree = layui.fsTree,
form = layui.form,
table = layui.table;
// table = layui.table;
tableTree = layui.tableTreeDj;
var ztree;
var id = GetUrlParam("id");
var objectKey = GetUrlParam("objectKey")
......@@ -50,7 +57,7 @@ layui.config({
}
function initLoadTable() {
table.render({
tableTree.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
......@@ -71,12 +78,18 @@ layui.config({
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
tableTree.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
}
// , {
// keyId: 'id',
// keyPid: 'parentId',
// title: 'dictName',
// }
);
table.on('tool(messageTable)', function (obj) {
tableTree.getTable().on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
......
......@@ -32,31 +32,16 @@
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
{{# if(d.state == 'pass' ) { }}
{{# if(d.state == 'pass' || d.state == 'partiallyCompleted') { }}
{{# if(auth('1571813426889')){ }}
<a class="layui-btn layui-btn-xs" lay-event="turnSales">转销售出库</a>
{{# } }}
{{# } }}
{{# if(d.state == 'partiallyCompleted') { }}
{{# if(auth('1571813426889')){ }}
<a class="layui-btn layui-btn-xs" lay-event="turnSales">转销售出库</a>
{{# } }}
{{# } }}
{{# if(d.state == 'pass') { }}
{{# if(auth('1720343655250')){ }}
<a class="layui-btn layui-btn-xs" lay-event="turnReturns">转销售退货</a>
{{# } }}
{{# } }}
{{# if(d.state == 'partiallyCompleted') { }}
{{# if(d.state == 'pass' || d.state == 'partiallyCompleted') { }}
{{# if(auth('1720343655250')){ }}
<a class="layui-btn layui-btn-xs" lay-event="turnReturns">转销售退货</a>
{{# } }}
{{# } }}
<!-- {{# if(d.state == 'partiallyCompleted') { }}-->
<!-- {{# if(auth('')){ }}-->
<!-- <a class="layui-btn layui-btn-xs" lay-event="turnReturns">转预生产计划</a>-->
<!-- {{# } }}-->
<!-- {{# } }}-->
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
......
......@@ -148,6 +148,12 @@
<artifactId>freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.27</version>
</dependency>
</dependencies>
<build>
......
......@@ -27,10 +27,8 @@ layui.config({
method: 'get',
url: sysMainMation.schoolBasePath + 'queryChapterListBySubjectClassesId',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
even: false,
page: false,
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'section', title: '章节', align: 'center', width: 100, templet: function (d) {
......@@ -39,9 +37,13 @@ layui.config({
{ field: 'name', title: '名称', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.createMation?.name);
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.lastUpdateMation?.name);
}},
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar' }
]],
......
......@@ -26,19 +26,21 @@ layui.config({
method: 'get',
url: sysMainMation.schoolBasePath + 'queryCoursewareListBySubjectClassesId',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
even: false,
page: false,
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'name', title: '名称', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
{ field: 'remark', title: '相关描述', align: 'left', width: 300},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.createMation?.name);
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.lastUpdateMation?.name);
}},
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar' }
]],
......
......@@ -76,7 +76,6 @@ layui.config({
//批改
function correct(data) {
console.log(11)
parent.parent._openNewWindows({
url: '../../tpl/homework/correct.html?id=' + data.id,
title: '作业批改',
......
......@@ -26,20 +26,22 @@ layui.config({
method: 'get',
url: sysMainMation.schoolBasePath + 'queryAssignmentListBySubjectClassesId',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
even: false,
page: false,
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'name', title: '名称', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
return '<a lay-event="details" class="notice-title-click">' + d.name + '</a>';
}},
{ field: 'content', title: '内容', align: 'left', width: 300},
{ field: 'endTime', title: '截止时间', align: 'left', width: 120 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.createMation?.name);
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 , templet: function(d) {
return getNotUndefinedVal(d.lastUpdateMation?.name);
}},
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar' }
]],
......
......@@ -23,10 +23,7 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'name', title: '姓名', align: 'center', width: 200},
{ field: 'accountNumber', title: '学号', align: 'left', width: 200 },
{ field: 'signature', title: '个性签名', align: 'left',width: 250},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 250 }
{ field: 'name', title: '姓名', align: 'center', width: 200}
]],
done: function(json) {
matchingLanguage();
......
......@@ -4,11 +4,21 @@
package com.skyeye;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import org.springframework.boot.context.properties.ConfigurationProperties;
import cn.hutool.core.util.StrUtil;
import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.PropertyKeyConst;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;
import com.skyeye.common.filter.PropertiesUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.yaml.snakeyaml.Yaml;
import java.util.Map;
import java.io.ByteArrayInputStream;
import java.util.*;
import java.util.stream.Collectors;
/**
* @ClassName: ConfigProperties
......@@ -19,20 +29,85 @@ import java.util.Map;
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
@Component
@ConfigurationProperties(prefix = "skyeye.configuation")
public class ConfigProperties {
public ConfigProperties() {
System.setProperty("skyeye.year", String.valueOf(DateUtil.thisYear()));
}
@Value("${spring.cloud.nacos.config.server-addr}")
private String serverAddr;
@Value("${spring.cloud.nacos.config.namespace}")
private String namespace;
@Value("${spring.application.name}.${spring.cloud.nacos.config.file-extension}")
private String dataId;
@Value("${spring.cloud.nacos.config.group}")
private String group;
public Map<String, String> bindPropertiesToObject(String env, String... prefix) {
try {
// 创建 Nacos 客户端
Properties properties = new Properties();
properties.setProperty(PropertyKeyConst.SERVER_ADDR, serverAddr);
properties.setProperty(PropertyKeyConst.NAMESPACE, namespace);
// 获取配置服务
ConfigService configService = NacosFactory.createConfigService(properties);
private Map<String, String> config;
// 获取配置
String content = configService.getConfig(dataId, group, 5000);
public Map<String, String> getConfig() {
return config;
// 使用SnakeYAML解析配置内容为Map
Yaml yaml = new Yaml();
ByteArrayInputStream stream = new ByteArrayInputStream(content.getBytes());
Map<String, Object> configMap = yaml.load(stream);
Map<String, String> result = new HashMap<>();
loadYamlConfig(result, configMap, prefix);
Map<String, String> temp = new HashMap<>();
String zuulApiKey = StrUtil.isEmpty(env) ? "${skyeye.zuulApi}" : "${skyeye." + env + ".zuulApi}";
String zuulApi = PropertiesUtil.getPropertiesValue(zuulApiKey);
temp.put(zuulApiKey, zuulApi);
temp.put("${skyeye.year}", String.valueOf(DateUtil.thisYear()));
result.forEach((key, value) -> {
temp.forEach((k, v) -> {
if (value.contains(k)) {
result.put(key, value.replace(k, v));
}
});
});
return result;
} catch (NacosException e) {
e.printStackTrace();
}
return null;
}
public void setConfig(Map<String, String> config) {
this.config = config;
public void loadYamlConfig(Map<String, String> result, Map<String, Object> configMap, String... keys) {
List<String> keyList = Arrays.asList(keys).stream().filter(StrUtil::isNotBlank).collect(Collectors.toList());
if (CollectionUtil.isEmpty(keyList)) {
configMap.forEach((key, value) -> {
result.put(key, value.toString());
});
return;
}
String key = keyList.get(0);
if (configMap.containsKey(key)) {
Object value = configMap.get(key);
if (value instanceof Map) {
if (keyList.size() == 1) {
loadYamlConfig(result, (Map<String, Object>) value, StrUtil.EMPTY);
} else {
loadYamlConfig(result, (Map<String, Object>) value, Arrays.copyOfRange(keys, 1, keys.length));
}
} else {
result.put(key, value.toString());
}
}
}
public Map<String, String> getConfig(String env) {
Map<String, String> map = bindPropertiesToObject(env, "skyeye", "configuation", "config", env);
return map;
}
}
......@@ -6,6 +6,7 @@ package com.skyeye;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
......@@ -25,8 +26,8 @@ public class ConfigrationController {
private ConfigProperties configProperties;
@GetMapping(value = "/getConfigRation")
public Map<String, String> getConfigRation() {
return configProperties.getConfig();
public Map<String, String> getConfigRation(@RequestParam("env") String env) {
return configProperties.getConfig(env);
}
}
......@@ -17,4 +17,5 @@ spring:
# 指定nacos server的地址
server-addr: 172.18.92.40:9000
file-extension: yml
namespace: ${spring.profiles.active} # 配置命名空间
\ No newline at end of file
namespace: ${spring.profiles.active} # 配置命名空间
group: DEFAULT_GROUP # 配置分组
\ No newline at end of file
......@@ -34,10 +34,13 @@ var customerJS = {
"schoolUtil": "../../assets/lib/layui/customer/skyeye/schoolUtil.js", // 学校模块工具类
};
// 登录界面赋值
var env = '';
//系统基础信息
var sysMainMation = {}; // 系统基础信息json
if (isNull(localStorage.getItem("sysMainMation"))) {
jsGetJsonFile("../../configRation.json", function(data) {
jsGetJsonFile("../../configRation.json?env=" + env, function(data) {
sysMainMation = data;
localStorage.setItem("sysMainMation", JSON.stringify(sysMainMation));
initBaseParams();
......
......@@ -9,9 +9,10 @@ layui.config({
winui.renderColor();
layui.use(['form'], function (form) {
var $ = layui.$;
env = GetUrlParam("env");
// 系统配置文件
jsGetJsonFile("../../configRation.json", function(data) {
jsGetJsonFile("../../configRation.json?env=" + env, function(data) {
sysMainMation = data;
localStorage.setItem("sysMainMation", JSON.stringify(sysMainMation));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册