优化菜单

This commit is contained in:
syruan 2025-03-24 15:45:00 +08:00
parent 9d549ccd38
commit 4392a1a7c0
7 changed files with 115 additions and 92 deletions

47
api/initPlan.json Normal file
View File

@ -0,0 +1,47 @@
{
"homeInfo": {
"title": "首页",
"href": "page/welcome-1.html?t=1"
},
"logoInfo": {
"title": "需求计划管理",
"image": "images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "常规管理",
"icon": "fa fa-address-book",
"href": "",
"target": "_self",
"child": [
{
"title": "需求计划管理",
"href": "",
"icon": "fa fa-book",
"target": "_self",
"child": [
{
"title": "需求计划申请",
"href": "page/aq_demand_plan/apply_plan_list.html",
"icon": "fa fa-navicon",
"target": "_self"
},
{
"title": "需求计划审核",
"href": "page/aq_demand_plan/apply_plan_audit_list.html",
"icon": "fa fa-shield",
"target": "_self"
},
{
"title": "采购发货",
"href": "page/aq_demand_plan/send_out_list.html",
"icon": "fa fa-shield",
"target": "_self"
}
]
}
]
}
]
}

View File

@ -141,6 +141,7 @@
miniAdmin = layui.miniAdmin,
miniTongji = layui.miniTongji;
let token = getUrlParam('token');
let isPlanAdd = getUrlParam('isPlanAdd');
if (!token) {
let gz_token = sessionStorage.getItem("gz-token");
if (gz_token) {
@ -162,7 +163,7 @@
url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
window.history.pushState({}, 0, url);
}
initPage(miniAdmin);
initPage(miniAdmin,isPlanAdd);
sessionStorage.setItem('us', JSON.stringify(result.data));
} else if (result.code === 401) {
closeWindowOpen();
@ -173,7 +174,7 @@
} else {
console.log('走的自己登录');
window.location = 'page/401.html';
// login(miniAdmin);
// login(miniAdmin,isPlanAdd);
// window.location = 'page/welcome-1.html';
}
/* var options = {
@ -206,23 +207,42 @@
});
});
// 初始化页面
function initPage(miniAdmin){
var options = {
iniUrl: "api/init.json", // 初始化接口
clearUrl: "api/clear.json", // 缓存清理接口
urlHashLocation: true, // 是否打开hash定位
bgColorDefault: false, // 主题默认配置
multiModule: true, // 是否开启多模块
menuChildOpen: false, // 是否默认展开菜单
loadingTime: 0, // 初始化加载时间
pageAnim: true, // iframe窗口动画
maxTabNum: 20, // 最大的tab打开数量
};
function initPage(miniAdmin,isPlanAdd){
console.log("进入initPage方法,isPlanAdd的值为:" + isPlanAdd);
let options;
if (isPlanAdd != null && isPlanAdd === "1") {
console.log("加载initPlanJSON");
options = {
iniUrl: "api/initPlan.json", // 初始化接口
clearUrl: "api/clear.json", // 缓存清理接口
urlHashLocation: true, // 是否打开hash定位
bgColorDefault: false, // 主题默认配置
multiModule: true, // 是否开启多模块
menuChildOpen: false, // 是否默认展开菜单
loadingTime: 0, // 初始化加载时间
pageAnim: true, // iframe窗口动画
maxTabNum: 20, // 最大的tab打开数量
};
} else {
console.log("加载initJSON");
options = {
iniUrl: "api/init.json", // 初始化接口
clearUrl: "api/clear.json", // 缓存清理接口
urlHashLocation: true, // 是否打开hash定位
bgColorDefault: false, // 主题默认配置
multiModule: true, // 是否开启多模块
menuChildOpen: false, // 是否默认展开菜单
loadingTime: 0, // 初始化加载时间
pageAnim: true, // iframe窗口动画
maxTabNum: 20, // 最大的tab打开数量
};
}
miniAdmin.render(options);
}
function login(miniAdmin) {
function login(miniAdmin,isPlanAdd) {
// 登录获取token
let login_url = dataUrl + 'login/userLogin'
const params = {
@ -230,51 +250,7 @@
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": 'ebbd6ea34bbab2b0813afcf59c8c9556',
}
/* const params = {
"username": 'fgs-check-001',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'fgs-check-002',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'fgs-check-003',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'xgzx-check-001',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'xgzx-check-002',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'xgzx-check-003',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'jj-check-001',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'jj-check-002',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
/* const params = {
"username": 'jj-check-003',
// "password": '3NBzZK7qxhMhrmvi63FnuQ==',
"password": '1769fb2837e10e9d22c1c25add76355a',
} */
// alert(params.username);
ajaxRequest(login_url, "POST", params, true, function () {
}, function (result) {
@ -282,7 +258,7 @@
if (result.code === 200) {
sessionStorage.setItem('gz-token', result.token);
sessionStorage.setItem('us', JSON.stringify(result.user));
initPage(miniAdmin);
initPage(miniAdmin,isPlanAdd);
} else if (result.code === 500) {
// layer.msg(result.msg, { icon: 2 });
}

View File

@ -39,16 +39,16 @@ function reloadData() {
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
page: {
curr: pageNum ? pageNum : 1,
page: {
curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
}),
},
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
}),
},
},
);
}
@ -205,7 +205,7 @@ function exportExcel() {
function getCheckStatus(statusType, status) {
var company = "";
if(statusType === '0' && status === '0'){
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>已撤回";
return "<span style='color:#FF9900;margin:0 5px 0 5px;font-size:16px'>●</span>已撤回";
}
if (statusType === '1') {
return "<span style='color:#19BE6B;margin:0 5px 0 5px;font-size:16px;'>●</span>审核通过";
@ -232,7 +232,7 @@ function showProcess() {
}
// 申请
function applyPlan(obj) {
openIframeByParamObj("apply_plan", "安全工器具需求计划申请", "./child/apply_plan_form.html", "92%", "95%", obj);
openIframeByParamObj("apply_plan", "需求计划申请(工器具、安全工器具、车辆)", "./child/apply_plan_form.html", "92%", "95%", obj);
}
// 申请修改

View File

@ -162,7 +162,7 @@ function initTable() {
{
field: "times",
width: "15%",
title: "退还日期",
title: "预计使用时间",
unresize: true,
align: "center",
templet: (d) =>

View File

@ -284,8 +284,8 @@ function initTable() {
},
],
],
limits: [10, 15, 20, 25, 50, 100],
limit: 10,
limits: [20, 15, 20, 25, 50, 100],
limit: 20,
page: true,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;

View File

@ -43,13 +43,13 @@
lay-verify="required" maxlength="50" lay-affix="clear">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label required" style="width: 110px !important;">施工地点</label>
<div class="layui-input-inline layui-input-wrap">
<input class="layui-input" name="projectContent" id="projectContent" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear">
</div>
</div>
<!-- <div class="layui-inline">-->
<!-- <label class="layui-form-label required" style="width: 110px !important;">施工地点</label>-->
<!-- <div class="layui-input-inline layui-input-wrap">-->
<!-- <input class="layui-input" name="projectContent" id="projectContent" autocomplete="off"-->
<!-- lay-verify="required" maxlength="50" lay-affix="clear">-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="layui-form-item">
<label class="layui-form-label required" style="width: 100px !important;">计划说明</label>

View File

@ -43,13 +43,13 @@
lay-verify="required" maxlength="50" lay-affix="clear">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label required" style="width: 110px !important;">施工地点</label>
<div class="layui-input-inline layui-input-wrap">
<input class="layui-input" name="projectContent" id="projectContent" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear">
</div>
</div>
<!-- <div class="layui-inline">-->
<!-- <label class="layui-form-label required" style="width: 110px !important;">施工地点</label>-->
<!-- <div class="layui-input-inline layui-input-wrap">-->
<!-- <input class="layui-input" name="projectContent" id="projectContent" autocomplete="off"-->
<!-- lay-verify="required" maxlength="50" lay-affix="clear">-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="layui-form-item">
<div class="layui-inline" style="display: flex;width:100%">
@ -127,7 +127,7 @@
<th style="width: 10%" class="center">规格</th>
<th style="width: 10%" class="center">单位</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>退还日期</th>
<th style="width: 15%" class="center">备注</th>
</tr>
</thead>
@ -253,7 +253,7 @@
<th style="width: 10%" class="center">规格</th>
<th style="width: 10%" class="center">单位</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>退还日期</th>
<th style="width: 15%" class="center">备注</th>
</tr>
</thead>
@ -390,7 +390,7 @@
<th style="width: 10%" class="center">规格</th>
<th style="width: 10%" class="center">单位</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>退还日期</th>
<th style="width: 15%" class="center">备注</th>
</tr>
</thead>