bug修复

This commit is contained in:
cwchen 2024-11-20 18:44:04 +08:00
parent a1cda8c01b
commit 58fa9d92fb
2 changed files with 18 additions and 1 deletions

View File

@ -1,7 +1,11 @@
let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj')));
let type = getUrlParam('type'); // type
let form, table, element, tableIns, layer;
let pageNum = 1;
layui.use(["form", "table", 'element', 'layer'], function () {
if(type){
objParam = JSON.parse(objParam);
}
form = layui.form;
table = layui.table;
element = layui.element;
@ -9,6 +13,19 @@ layui.use(["form", "table", 'element', 'layer'], function () {
initTable();
});
function isJsonString(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
function isJsonObject(obj) {
return obj && typeof obj === 'object' && !Array.isArray(obj) && !isJsonString(JSON.stringify(obj));
}
// 查询/重置
function queryTable(type) {
if (type === 1) {

View File

@ -13,7 +13,7 @@ function setParams(obj) {
element.on('tab(demo-filter-tab)', function (data) {
let value = $(this).attr('value');
if (value === '') { // 全部
$('#indexIframe').attr('src', 'delivery_all_list.html?obj=' + encodeURIComponent(JSON.stringify(obj)));
$('#indexIframe').attr('src', 'delivery_all_list.html?obj=' + encodeURIComponent(JSON.stringify(obj)) + '&type=' + 1);
} else if (value !== '0') {
let time = $(this).attr('tiem');
$('#indexIframe').attr('src', 'delivery_batch_list.html?obj=' + encodeURIComponent(JSON.stringify(obj)) + '&id=' + value + '&time=' + time);