优化菜单

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

View File

@ -39,16 +39,16 @@ function reloadData() {
// 重载表格 // 重载表格
function reloadTable(pageNum) { function reloadTable(pageNum) {
table.reload("currentTableId", { table.reload("currentTableId", {
page: { page: {
curr: pageNum ? pageNum : 1, curr: pageNum ? pageNum : 1,
},
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
}),
},
}, },
where: {
encryptedData: JSON.stringify({
'keyWord': $('#keyWord').val(),
'status': $('#status').val(),
}),
},
},
); );
} }
@ -232,7 +232,7 @@ function showProcess() {
} }
// 申请 // 申请
function applyPlan(obj) { 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", field: "times",
width: "15%", width: "15%",
title: "退还日期", title: "预计使用时间",
unresize: true, unresize: true,
align: "center", align: "center",
templet: (d) => templet: (d) =>

View File

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

View File

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