Commit 486a8f14 authored by 黄奎's avatar 黄奎

座位图修改

parent 65772c55
...@@ -410,6 +410,15 @@ ...@@ -410,6 +410,15 @@
var flag = col_input % 2 == 1 ? true : false; var flag = col_input % 2 == 1 ? true : false;
var rightArray = []; var rightArray = [];
var leftArray = []; var leftArray = [];
var leftCount = 0;
var rightCount = 0;
var shopType = 2;
var leftNewArray = [];
var rightNewArray = [];
var newArray =[];
var resultArray = [];
if (shopType == 1) {
for (var i = 0; i < newObj.ColumnArray.length; i++) { for (var i = 0; i < newObj.ColumnArray.length; i++) {
//单数列 //单数列
if (flag) { if (flag) {
...@@ -419,6 +428,7 @@ ...@@ -419,6 +428,7 @@
} }
else { else {
leftArray.push(i + 1); leftArray.push(i + 1);
leftCount++;
} }
} }
else { else {
...@@ -427,6 +437,7 @@ ...@@ -427,6 +437,7 @@
} }
else { else {
rightArray.push(i + 1); rightArray.push(i + 1);
rightCount++;
} }
} }
} }
...@@ -438,6 +449,7 @@ ...@@ -438,6 +449,7 @@
} }
else { else {
leftArray.push(i + 1); leftArray.push(i + 1);
leftCount++;
} }
} }
else { else {
...@@ -446,12 +458,12 @@ ...@@ -446,12 +458,12 @@
} }
else { else {
rightArray.push(i + 1); rightArray.push(i + 1);
rightCount++;
} }
} }
} }
} }
var leftIndex = 1; var leftIndex = 1;
var leftNewArray = [];
for (var i = leftArray.length - 1; i >= 0; i--) { for (var i = leftArray.length - 1; i >= 0; i--) {
if (leftArray[i] != "0") { if (leftArray[i] != "0") {
leftNewArray.push(leftIndex * 2); leftNewArray.push(leftIndex * 2);
...@@ -463,7 +475,6 @@ ...@@ -463,7 +475,6 @@
} }
var rightIndex = 1; var rightIndex = 1;
var rightNewArray = [];
for (var i = 0; i < rightArray.length; i++) { for (var i = 0; i < rightArray.length; i++) {
if (rightArray[i] != "0") { if (rightArray[i] != "0") {
rightNewArray.push((rightIndex * 2 - 1)); rightNewArray.push((rightIndex * 2 - 1));
...@@ -473,8 +484,53 @@ ...@@ -473,8 +484,53 @@
rightNewArray.push("0"); rightNewArray.push("0");
} }
} }
var newArray = leftNewArray.reverse(); newArray = leftNewArray.reverse();
var resultArray = newArray.concat(rightNewArray); resultArray = newArray.concat(rightNewArray);
}
else {
var singleArray = [];
var doubleArray = [];
var newObjArray = [];
var chooseIndex = 1;
for (var i = 0; i < newObj.ColumnArray.length; i++) {
if (newObj.ColumnArray[i].SeatClassStr == 'noSeat') {
newObjArray.push({ ID: i, Value: 0 });
}
else {
if (i % 2 == 0) {
singleArray.push(chooseIndex);
}
else {
doubleArray.push(chooseIndex);
}
chooseIndex++;
newObjArray.push({ID:i,Value:1});
}
}
var doubleIndex = 0;
var singleIndex = 0;
if (doubleArray != null && doubleArray.length > 0) {
doubleIndex = doubleArray.length - 1;
}
for (var i = 0; i < newObjArray.length; i++) {
if (newObjArray[i].Value == 1) {
if (doubleIndex >= 0) {
resultArray.push(doubleArray[doubleIndex]);
doubleIndex--;
}
else {
if (singleIndex < singleArray.length) {
resultArray.push(singleArray[singleIndex]);
singleIndex++;
}
}
}
else {
resultArray.push("0");
}
}
}
for (var k = 0; k < newObj.ColumnArray.length; k++) { for (var k = 0; k < newObj.ColumnArray.length; k++) {
newObj.ColumnArray[k].col = resultArray[k]; newObj.ColumnArray[k].col = resultArray[k];
...@@ -507,7 +563,6 @@ ...@@ -507,7 +563,6 @@
} }
} }
} }
} }
else if (isAdd == 0 && newObj.rowIndex == "") { else if (isAdd == 0 && newObj.rowIndex == "") {
newObj.rowIndex = (dataRowIndex + 1) + "排"; newObj.rowIndex = (dataRowIndex + 1) + "排";
...@@ -532,7 +587,6 @@ ...@@ -532,7 +587,6 @@
} }
} }
} }
} }
else { else {
SeatData.replace(SeatData()[dataRowIndex], newObj); SeatData.replace(SeatData()[dataRowIndex], newObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment